Communication between applets in seperate browswer windows?

R

Richard Smol

Hi there,

I have this web-application where is one main applet, that opens
several browser windows and then has to be notified whenever something
changes in those windows (like, when they close down or reload after
submitting a value).

Now, I was thinking for using an invisible applets that sends
lifetime-changes to the main applet... but very much to my dismay
inter-applet communication doesn't work between seperate browser
windows.. at least not under Internet Explorer 6.

Does anyone have any idea how something like this could be implemented?
My personal choice would be to let the applets communicate through
sockets on a server, but that solution is not feasible here because of
various reasons.

Thanks in advance!

RS
 
A

Anton Spaans

Richard Smol said:
Hi there,

I have this web-application where is one main applet, that opens
several browser windows and then has to be notified whenever something
changes in those windows (like, when they close down or reload after
submitting a value).

Now, I was thinking for using an invisible applets that sends
lifetime-changes to the main applet... but very much to my dismay
inter-applet communication doesn't work between seperate browser
windows.. at least not under Internet Explorer 6.

Does anyone have any idea how something like this could be implemented?
My personal choice would be to let the applets communicate through
sockets on a server, but that solution is not feasible here because of
various reasons.

Thanks in advance!

RS

I don't know whether this is a java topic, but here it is anyway :)

This is what i would try in Javascript - if Java code in applets don't allow
you to get the 'Browser'-object (i don't know if it would work, though):

Say one applet is in a browser window, that can be referenced in javascript
by the variable 'window'.
Then, open from this window a second window "var otherWin =
window.open(...)". Now, through the variables 'window' and 'otherWin' and
'otherWin.opener' (all 'window' objects in javascript), you can reach either
applet. Use (event-)listeners, implemented in javascript to communicate from
applet to applet.

-- Anton.
 
R

Richard Smol

Anton said:
I don't know whether this is a java topic, but here it is anyway :)

This is what i would try in Javascript - if Java code in applets don't allow
you to get the 'Browser'-object (i don't know if it would work, though):

Say one applet is in a browser window, that can be referenced in javascript
by the variable 'window'.
Then, open from this window a second window "var otherWin =
window.open(...)". Now, through the variables 'window' and 'otherWin' and
'otherWin.opener' (all 'window' objects in javascript), you can reach either
applet. Use (event-)listeners, implemented in javascript to communicate from
applet to applet.

Thanks. I have tried this, but it doesn't work since I can't call
functions on Java applets from JavaScript in IE. Also, the windows
are being opened from inside the Java applet, not through JavaScript.

RS
 
A

Andrew Thompson

I have this web-application ..

Does what?
..where..

Where? URL?
.. is one main applet,

Why an applet? Is there something you are doing that cannot
be done in HTML?
..that opens several browser windows ..

Either reduce your web-app to a single browser window, or triple
the budget for maintenance. 'new windows' (aka pop-ups) are hated
by users, and going the way of the dinosaurs.

BTW - two important questions. Is this a 'business critical'
web-app, or merely 'added extras'. Is it to be deployed in a
controlled environment such as an intranet, or will it be
subjected to the wilds of the internet?
..and then has to be notified whenever something
changes in those windows (like, when they close down or reload after
submitting a value).

Now, I was thinking for using an invisible applets that sends
lifetime-changes to the main applet... but very much to my dismay
inter-applet communication doesn't work between seperate browser
windows.. at least not under Internet Explorer 6.

How are you doing it[1]? What Java version is your IE using[2]?
[1] <http://www.physci.org/codes/sscce.jsp>
Does anyone have any idea how something like this could be implemented?
My personal choice would be to let the applets communicate through
sockets on a server, but that solution is not feasible here because of
various reasons.

...because ..your sockets have holes in the toes? No?
Well perhaps you had better fill those details in as well.

Sockets would be one good way to allow the applets to communicate,
though I suspect you are doing something wrong when you attempt
to connect to the other applets.
 
R

Richard Smol

Andrew said:
Does what?

It contains a chart, which has to be filled in through Cool:Gen
generated forms.
Where? URL?
Intranet


Why an applet? Is there something you are doing that cannot
be done in HTML?

It's a very complicated, highly interactive chart. Besides, the
decision to use it has been made long before I entered the scene.
Either reduce your web-app to a single browser window,

Not possible, since all forms have been generated by
Cool:Gen. That's just how the beastie works.
or triple
the budget for maintenance. 'new windows' (aka pop-ups) are hated
by users, and going the way of the dinosaurs.

Well, it mimicks the way the old application works. And again,
it's not my decision, bla bla bla :)
BTW - two important questions. Is this a 'business critical'
web-app, or merely 'added extras'. Is it to be deployed in a
controlled environment such as an intranet, or will it be
subjected to the wilds of the internet?

It's business critial alright. It will be confined within
the bounds of a highly secretive intranet :)
..and then has to be notified whenever something
changes in those windows (like, when they close down or reload after
submitting a value).

Now, I was thinking for using an invisible applets that sends
lifetime-changes to the main applet... but very much to my dismay
inter-applet communication doesn't work between seperate browser
windows.. at least not under Internet Explorer 6.


How are you doing it[1]? What Java version is your IE using[2]?
[1] <http://www.physci.org/codes/sscce.jsp>
[2] <http://www.physci.org/pc/property.jsp?prop=java.version>
1.4.2_06
Does anyone have any idea how something like this could be implemented?
My personal choice would be to let the applets communicate through
sockets on a server, but that solution is not feasible here because of
various reasons.


..because ..your sockets have holes in the toes? No?
Well perhaps you had better fill those details in as well.

*Looks sheepishly*
uh... like... tcp/ip sockets?
Sockets would be one good way to allow the applets to communicate,
though I suspect you are doing something wrong when you attempt
to connect to the other applets.

Even worse: I did find a way to do it. HAHA! Now I can
finally take over the world! Or just get this application
started :)

Thanks for your input...

RS
 
A

Andrew Thompson

Even worse: I did find a way to do it.

I do not know why that is 'even worse', but if you found a way
to do it that works.. good. What was the problem/solution?
...HAHA!
?

..Now I can finally take over the world!
??

...Or just get this application started :)
;-)

Thanks for your input...

You're welcome.
 
J

John C. Bollinger

Richard said:
I have this web-application where is one main applet, that opens
several browser windows and then has to be notified whenever something
changes in those windows (like, when they close down or reload after
submitting a value).

Now, I was thinking for using an invisible applets that sends
lifetime-changes to the main applet... but very much to my dismay
inter-applet communication doesn't work between seperate browser
windows.. at least not under Internet Explorer 6.

It isn't supposed to work. In fact, it is specifically supposed to NOT
work. In principal, applets should be able to communicate with each
other *within the same document*, but even that (accomplished with use
of the applet's AppletContext to find the other applet instances) can be
flaky. Documents displayed in different windows, even if they have the
same source, are different documents.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top