> -----Urspr?ngliche Nachricht-----
> Von: "Hussein Shafie" <hussein at xmlmind.com>
> Gesendet: 26.08.09 12:31:25
> An: Michael Weisheit <m.weisheit at web.de>
> CC: "xmleditor-support at xmlmind.com" <xmleditor-support at xmlmind.com>
> Betreff: Re: [XXE] Communication between Applet and javascript


> Michael Weisheit wrote:
> > 
> > the problem is that I need the Applet-Object in JSObject.getWindow(Applet 
> > applet). Can I get the Object maybe from getApp().get...??? oder something 
> > else?
> > 
> 
> It's:
> 
> ((com.xmlmind.xmleditapp.app.ApplicationBase) app).getApplet()
> 
> See 
> http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/app/ApplicationBase.html#getApplet()
> 
> Now, how to access *app* ? the answer is: it depends on the kind of 
> extension you write. (No, there is no global variable pointing to the 
> application object.)
> 
> For example, any application part (AppAction, AppTool, etc) has access 
> to the application which contains it. See for example: 
> http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/AppAction.html#app
> 
> 

Hi,

I got it. It's not a big deal. I just wrote a subclass of AppTool which 
executes these lines when a button is clicked:

        Applet applet = ((com.xmlmind.xmleditapp.app.ApplicationBase) 
app).getApplet();
        JSObject win = JSObject.getWindow(applet);
        win.call("showAlert", null);

Also in the plugin, you have to include the "plugin.jar" from %JRE-HOME%\lib\ 
to use the class JSObject. And add this jar to the cp in the build.xml.

Then add to the html-Header this example function:

        function showAlert() {
                alert('See this nice javascript alert called from inside the 
applet!');
        }


Now it should work fine.


Greetings,
Michael
______________________________________________________
GRATIS f?r alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

Reply via email to