• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamically change Applet param via javascript

 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have an Applet which i'm loading through an HTML file with a list of parameters names and values.
I would like to add the feature of being able to dynamically change param values via javascript.

is this possible and how can it be done?

thanking you much
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may be able to change the page DOM through JavaScript, but once an applet is initialized, any change of the page won't be reflected in the applet. To influence a running applet via JavaScript, you need to access its public fields and methods via LiveConnect, and react accordingly in your applet code. The Applets FAQ has some links about LiveConnect.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Applets forum.
 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf for replying

I do agree with you on the issue of applet params never get updated once applet is initialized.
This means I'm in a real trouble how to handel this issue.
are you aware of some open source library for updating applet params via javascript ?
i would appreciate any help.
thanks.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you missed my point. It may actually be possible to update the parameters in the page DOM, but that's irrelevant because they are never read again after the initial loading of the applet. Have a look at LiveConnect instead.
 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I probably need to explain more what I want to do in this applet/javascript communication:

My applet has a param named "urlList" .it's value is a comma delimited list of http urls.
in applet init() method I getParameter("urlList") parse the value and store the urls in a vector.

Now I want to be able to add and remove URLs to the url List via javascript in RunTime i.e after applet is loaded and initialized.
I suspect the add/remove will be applied to this Vector via Javascript as explained by other posters.
what is the best way to approach this problem ?

Many thanks.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what "other posters" said -there don't seem to be any in this thread- but that's precisely what LiveConnect can do, and no other approach will work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic