pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Load url from applet
Date Tue, 27 Apr 2010 11:58:48 GMT
You should just be able to call:

  BrowserApplicationContext.eval("loadPage()", myApplication);

This demo app does something similar:

  http://svn.apache.org/repos/asf/pivot/trunk/demos/src/org/apache/pivot/demos/dom/DOMInteractionDemo.java

The HTML page defines the following function, which is called by the button press listener
defined in startup():

    <script type="text/javascript">
        // This function will be called by Pivot
        function sayHello(helloText) {
            alert(helloText);
        }
    </script>

On Apr 27, 2010, at 3:22 AM, Jérôme Serré wrote:

> I am sorry Greg but I don't know to do it.
> The html page is "administration.html", there is a script (js) :
> 
> <html>
> ....
> <script>
> function loadPage() { window.location.replace("/ihm/page/relecture.html"); }
> </script>
> ....
> application_class_name:"ihm.applet.Administration"
> ...
> deployJava.runApplet(attributes, parameters, "1.6");
> ....
> </html>
> 
> How execute the function "loadPage" form applet Administration ?
> Could you tell me an example ?
> 
> 
> -----Message d'origine-----
> De : Greg Brown [mailto:gkbrown@mac.com] 
> Envoyé : lundi 26 avril 2010 18:08
> À : user@pivot.apache.org
> Objet : Re: Load url from applet
> 
> The application name is just the name of the applet hosting the application.
> However, you don't need that to call eval() - you just need the application
> instance.
> 
> On Apr 26, 2010, at 12:02 PM, Jérôme Serré wrote:
> 
>> Thank you,
>> I will use BrowserApplicationContext.eval(), but I don't know how to get
> the
>> name of Application. 
>> Is it the name of the page or do I create loading and how ?
>> 
>> -----Message d'origine-----
>> De : Greg Brown [mailto:gkbrown@mac.com] 
>> Envoyé : lundi 26 avril 2010 16:12
>> À : user@pivot.apache.org
>> Objet : Re: Load url from applet
>> 
>> One approach is to use java.awt.Desktop#browse(). This works well because
> it
>> works for both desktop and browser application contexts. However, it will
>> generally open the page in a new window, which may not be what you want.
>> 
>> You can also use BrowserApplicationContext.eval(), which can be used to
>> execute arbitrary JavaScript in the page. However, this only works when
>> running in the browser.
>> 
>> On Apr 26, 2010, at 10:06 AM, Jérôme Serré wrote:
>> 
>>> Hello,
>>> 
>>> Is it possible to load a page in the browser from an applet pivot ?
>>> something like:
>>> getAppletContext (). showDocument (new URL ());
>>> 
>>> Thanks
>>> 
>>> 
>>> 
>>> 
>>> 
>>> __
>>> 
>>> Cordialement
>>> 
>>> Jérôme Serré
>>> 
>>> 
>>> 
>>> 
>> 
> 


Mime
View raw message