This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Applets and the fly likes Javascript method reinitialising applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Javascript method reinitialising applet" Watch "Javascript method reinitialising applet" New topic
Author

Javascript method reinitialising applet

Ghita Benkirane
Greenhorn

Joined: Jan 10, 2012
Posts: 2
Hi,
I have an applet inside a jsf page and I access its methods through javaScript.
when I try to call a method using a button inside the applet it works fine, but when I try to call the method through a javaScript it runs the code but reinitializes the applet, so I loose my data. The javascript method is wrapping the applet method scan() to be able to access the scanner.

How can I prevent the javascript from reinitilizing the applet?


public void javaScriptScan() {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
scan();
return null;
}
});
}
Ghita Benkirane
Greenhorn

Joined: Jan 10, 2012
Posts: 2
Sorry, the problem was not related to the applet, but to the jsf page containing the applet.
Problem solved
 
 
subject: Javascript method reinitialising applet