pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: AW: AW: request focus in my pivot applet on page load
Date Tue, 14 Dec 2010 15:10:50 GMT
I don't have such an example.  :-)  But this is more of a JDK issue than something specific
to Pivot. Maybe you can find an answer on oracle.com?

On Dec 14, 2010, at 10:02 AM, Felix Eckhardt wrote:

> Thanks for you quick help! I’ve tried it  on:
>  
> Chrome 8.0.522.215
> Firefox 3.6.13
>  
> I would really appreciate, if you could send me a running html + pivot applet, which
gain’s the focus automaticly on page load.
>  
> Felix
>  
> Von: Greg Brown [mailto:gk_brown@verizon.net] 
> Gesendet: Dienstag, 14. Dezember 2010 15:52
> An: user@pivot.apache.org
> Betreff: Re: AW: request focus in my pivot applet on page load
>  
> What web browser are you using?
>  
> On Dec 14, 2010, at 9:34 AM, Felix Eckhardt wrote:
> 
> 
> I’ve already done that. Here is my code:
>  
> <body onload="onload();">
>       <script type="text/javascript">
>       onload = function()     {
>             document.getElementById('applet').focus();
>       }
> </script>
>       <applet code="org.apache.pivot.wtk.BrowserApplicationContext$HostApplet"
>             id="applet"
>             codebase="http://localhost:8080/demo/test/lib" width="360"
>             height="380">
>             <param name="archive"
>                   value="demoPivot.jar,pivot-core-1.5.1.jar,pivot-web-1.5.1.jar,pivot-wtk-1.5.1.jar,pivot-wtk-terra-1.5.1.jar"
/>
>             <param name="application_class_name"
>                   value="com.example.applet.demo.DemoPivot" />
>             <param name="java_arguments" value="-Dorg.apache.pivot.wtk.debugfocus=true"/>
>       </applet>
> </body>
>  
> I also tried to set the focus with a delay using a javascript timer. But nothing works.
The cursor is blinking inside the TextInput, but I can’t start typing without clicking on
the applet.
>  
>  
> Von: Greg Brown [mailto:gk_brown@verizon.net] 
> Gesendet: Dienstag, 14. Dezember 2010 15:16
> An: user@pivot.apache.org
> Betreff: Re: request focus in my pivot applet on page load
>  
> You may also need to request focus to the applet itself in the HTML page, using JavaScript.
I haven't tried it myself, but it should work. Let me know how it goes.
>  
> On Dec 14, 2010, at 8:55 AM, Felix Eckhardt wrote:
> 
> 
> 
> How do I request focus for my applet after a page load, which is inside a html page.
The applet should be the first item which receives the focus after a page reload.
>  
> I tried requestFocus() on my components inside my applet (even with a timer delayed),
but I always have to click on the applet with my mouse to gain focus and be able to start
typing in a TextInput.
>  
> What I am doing wrong? Thank you for your help!
>  
> Greetings
> Felix
>  
>  


Mime
View raw message