You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/09/11 14:20:18 UTC

Multi Applet Tutorial / Demo

Hi to all,
someone has tried if all works good (and how) with a page containing
more than 1 Applet ?
This could help to see if there are issues with static variables etc ...

Since Java 6 Update 10 there is a new ability, to tell to the Java
Plugin if use the same JVM for more applets, or if not ... i don't
remember well at the moment.


And then, we could try exchanging data between them (i remember on old
demo of this feature in core java tutorials, if i remember well).

And also maybe with interaction from / to javascript ...
Or maybe this could be an extension of the "DOM Interaction" Demo.

Bye

Re: Multi Applet Tutorial / Demo

Posted by Sandro Martini <sa...@gmail.com>.
Ok, thanks for the moment.

Bye

Re: Multi Applet Tutorial / Demo

Posted by Greg Brown <gk...@mac.com>.
> so what do you think on providing a sample of this interaction, useful
> also to us to see if all works in the right way, ok ?

Sounds good.

> And a last thing, not strictly related to this:
> with Flash / Flex, an interesting feature is that when desired, it's
> possible to enable linkage to an element in the movie to the outside
> page (with a link from a page, or via Javascript), so for example i
> could refer to a screen or a button or other from the browser, with an
> url like "page.html#myMovieLinkedElement" or similar.
> At the moment I don't find a link to some sample, sorry.
>
> In our applets we can do a simplified version of this passing an
> argument, ok ... but what do you think ?

You can get access to the Pivot application instance from the applet.  
You can then access any properties and methods exposed by the  
application. For example, from the "DOM Interaction" demo:

     var domTestApplet = document.getElementById("domTestApplet");
     domTestApplet.getApplication().sayHello("Hello from JavaScript!");

> And are we able to make things like stop /start / pause / resume
> application, could be useful for some things ...

Technically, since you can get a reference to the application, you can  
call these methods. I'm not sure I would recommend it, though. These  
methods are really only meant to be called by the application context.


Re: Multi Applet Tutorial / Demo

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,
so what do you think on providing a sample of this interaction, useful
also to us to see if all works in the right way, ok ?


And a last thing, not strictly related to this:
with Flash / Flex, an interesting feature is that when desired, it's
possible to enable linkage to an element in the movie to the outside
page (with a link from a page, or via Javascript), so for example i
could refer to a screen or a button or other from the browser, with an
url like "page.html#myMovieLinkedElement" or similar.
At the moment I don't find a link to some sample, sorry.

In our applets we can do a simplified version of this passing an
argument, ok ... but what do you think ?

And are we able to make things like stop /start / pause / resume
application, could be useful for some things ...


Bye

Re: Multi Applet Tutorial / Demo

Posted by Greg Brown <gk...@mac.com>.
> someone has tried if all works good (and how) with a page containing
> more than 1 Applet ?

Yes, though I don't think it was ever checked in anywhere.

> Since Java 6 Update 10 there is a new ability, to tell to the Java
> Plugin if use the same JVM for more applets, or if not ... i don't
> remember well at the moment.

The parameter is called "separate_jvm".

> And then, we could try exchanging data between them (i remember on old
> demo of this feature in core java tutorials, if i remember well).

We don't provide access to the underlying applets directly. However,  
if you name your applets, you can call  
BrowserApplicationContext.getApplication() to get the Pivot  
application that is hosted by the named applet.