You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Felix Eckhardt <Fe...@starfinanz.de> on 2010/12/14 14:55:40 UTC

request focus in my pivot applet on page load

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


Re: AW: AW: AW: request focus in my pivot applet on page load

Posted by Sandro Martini <sa...@gmail.com>.
Hi Felix,
thanks for the ticket, as Greg said could not be a Pivot issue, I'll try to
look inside as soon as possible (an eye on this could be useful) :-) ...

Bye,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2092096.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: AW: AW: request focus in my pivot applet on page load

Posted by Greg Brown <gk...@verizon.net>.
I was referring to this:

> It's strange that nobody else ever found this bug :)

What I was trying to say was that I *had* found this bug - just didn't realize that it might have been an issue with Pivot, not the JRE.

On Dec 17, 2010, at 4:09 AM, Felix Eckhardt wrote:

> And as I said: I've created two examples. Both pretty simple. A Applet with a simple TextField. One created with plain applet (swing JTextField) and one created with pivot.
> 
> Only the plain applet version gains the focus on page load. Try it by yourself. You can find the example in the jira issue.
> 
> -----Ursprüngliche Nachricht-----
> Von: Greg Brown [mailto:gk_brown@verizon.net] 
> Gesendet: Mittwoch, 15. Dezember 2010 13:30
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: AW: request focus in my pivot applet on page load
> 
> I have seen this issue - as I said, I just assumed that it affected all applets, not just Pivot ones.
> 
> On Dec 15, 2010, at 5:18 AM, Felix Eckhardt wrote:
> 
>> Hello Sandro,
>> 
>> I've created a jira issue:
>> https://issues.apache.org/jira/browse/PIVOT-686
>> 
>> It's strange that nobody else ever found this bug :)
>> 
>> Thanks,
>> Felix
>> 
>> -----Ursprüngliche Nachricht-----
>> Von: Sandro Martini [mailto:sandro.martini@gmail.com] 
>> Gesendet: Mittwoch, 15. Dezember 2010 10:47
>> An: user@pivot.apache.org
>> Betreff: Re: AW: AW: request focus in my pivot applet on page load
>> 
>> 
>> Hi Felix,
>> to proceed with some tests on this, can you file an issue in out JIRA, so we
>> can look/fix it in the 2.0.x ?
>> 
>> Could be good even to have in the ticket a link to this thread (
>> http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-td2085547.html
>> ), and maybe even the your test applet in attach.
>> 
>> Thank you very much for your time,
>> Sandro
>> 
>> -- 
>> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2091123.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 


AW: AW: AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
And as I said: I've created two examples. Both pretty simple. A Applet with a simple TextField. One created with plain applet (swing JTextField) and one created with pivot.

Only the plain applet version gains the focus on page load. Try it by yourself. You can find the example in the jira issue.

-----Ursprüngliche Nachricht-----
Von: Greg Brown [mailto:gk_brown@verizon.net] 
Gesendet: Mittwoch, 15. Dezember 2010 13:30
An: user@pivot.apache.org
Betreff: Re: AW: AW: AW: request focus in my pivot applet on page load

I have seen this issue - as I said, I just assumed that it affected all applets, not just Pivot ones.

On Dec 15, 2010, at 5:18 AM, Felix Eckhardt wrote:

> Hello Sandro,
> 
> I've created a jira issue:
> https://issues.apache.org/jira/browse/PIVOT-686
> 
> It's strange that nobody else ever found this bug :)
> 
> Thanks,
> Felix
> 
> -----Ursprüngliche Nachricht-----
> Von: Sandro Martini [mailto:sandro.martini@gmail.com] 
> Gesendet: Mittwoch, 15. Dezember 2010 10:47
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: request focus in my pivot applet on page load
> 
> 
> Hi Felix,
> to proceed with some tests on this, can you file an issue in out JIRA, so we
> can look/fix it in the 2.0.x ?
> 
> Could be good even to have in the ticket a link to this thread (
> http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-td2085547.html
> ), and maybe even the your test applet in attach.
> 
> Thank you very much for your time,
> Sandro
> 
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2091123.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: AW: AW: AW: request focus in my pivot applet on page load

Posted by Greg Brown <gk...@verizon.net>.
I have seen this issue - as I said, I just assumed that it affected all applets, not just Pivot ones.

On Dec 15, 2010, at 5:18 AM, Felix Eckhardt wrote:

> Hello Sandro,
> 
> I've created a jira issue:
> https://issues.apache.org/jira/browse/PIVOT-686
> 
> It's strange that nobody else ever found this bug :)
> 
> Thanks,
> Felix
> 
> -----Ursprüngliche Nachricht-----
> Von: Sandro Martini [mailto:sandro.martini@gmail.com] 
> Gesendet: Mittwoch, 15. Dezember 2010 10:47
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: request focus in my pivot applet on page load
> 
> 
> Hi Felix,
> to proceed with some tests on this, can you file an issue in out JIRA, so we
> can look/fix it in the 2.0.x ?
> 
> Could be good even to have in the ticket a link to this thread (
> http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-td2085547.html
> ), and maybe even the your test applet in attach.
> 
> Thank you very much for your time,
> Sandro
> 
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2091123.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


AW: AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
Hello Sandro,

I've created a jira issue:
https://issues.apache.org/jira/browse/PIVOT-686

It's strange that nobody else ever found this bug :)

Thanks,
Felix

-----Ursprüngliche Nachricht-----
Von: Sandro Martini [mailto:sandro.martini@gmail.com] 
Gesendet: Mittwoch, 15. Dezember 2010 10:47
An: user@pivot.apache.org
Betreff: Re: AW: AW: request focus in my pivot applet on page load


Hi Felix,
to proceed with some tests on this, can you file an issue in out JIRA, so we
can look/fix it in the 2.0.x ?

Could be good even to have in the ticket a link to this thread (
http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-td2085547.html
), and maybe even the your test applet in attach.

Thank you very much for your time,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2091123.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: request focus in my pivot applet on page load

Posted by Sandro Martini <sa...@gmail.com>.
Hi Felix,
to proceed with some tests on this, can you file an issue in out JIRA, so we
can look/fix it in the 2.0.x ?

Could be good even to have in the ticket a link to this thread (
http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-td2085547.html
), and maybe even the your test applet in attach.

Thank you very much for your time,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2091123.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: request focus in my pivot applet on page load

Posted by João Neves <se...@gmail.com>.
Oh, awesome. :)

I might be able to put what you found to good use!

Thanks!

--
João Neves



On Tue, Dec 14, 2010 at 18:16, Felix Eckhardt
<Fe...@starfinanz.de> wrote:
> Hey João,
>
> I think it's a pivot issue. I’ve created a simple Applet and a pivot example:
>
> Applet Version (immediate focus works):
> http://betrunken.de/media/appletFocusDemo/appletPlainDemo.html
>
> Pivot Version (immediate focus doesn’t work):
> http://betrunken.de/media/appletFocusDemo/pivotPlainDemo.html
>
> Try to start typing after reload. I've tested this with Chrome and Firefox. It works only for the applet version.
>
> You can download the source from:
> http://betrunken.de/media/appletFocusDemo/demoApplet.jar
>
> I appreciate any hint :)
>
> -----Ursprüngliche Nachricht-----
> Von: João Neves [mailto:sevenjp@gmail.com]
> Gesendet: Dienstag, 14. Dezember 2010 16:41
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: request focus in my pivot applet on page load
>
> Hi,
>
> Correct me if I'm wrong, but from experience some browsers will
> probably just stop you from gaining focus on an embedded object. For
> instance, Firefox doesn't let you gain focus on an embedded SWF due to
> the way external plugins are dealt with in the browser. Since Java
> applets need the Java plug-in pretty much in the same way SWF objects
> need the Flash plug-in installed, I fear you're out of luck. At least
> in the case of Firefox and Flash you can't even lose focus from the
> SWF object without clicking outside of it.
>
> Some browsers (like some versions of IE, I believe) may let you do it
> with some of the Javascript trickery Greg mentioned above, but
> cross-browser... I don't think it's doable right now. AFAIK, the guys
> at Mozilla have been trying to get focus management work better with
> Flash et al, but I don't think they have anything ready any time soon.
>
> Of course, it's been a while since I last tried to do something like
> that (and gave up), so I may not be completely right. :-)
>
> Cheers!
>
> --
> João Neves
>
>
>
> On Tue, Dec 14, 2010 at 15:28, Felix Eckhardt
> <Fe...@starfinanz.de> wrote:
>> I've tried these example too. None of them focus an element after page load, which can be controlled immediatily with the keyboard.
>>
>> I always have to click on them to gain focus. Do you have a different behaviour with your browser?
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Sandro Martini [mailto:sandro.martini@gmail.com]
>> Gesendet: Dienstag, 14. Dezember 2010 16:23
>> An: user@pivot.apache.org
>> Betreff: Re: AW: AW: request focus in my pivot applet on page load
>>
>>
>> Hi,
>> have you tried to use the Java deploy Script to load the Applet in the page
>> (you can see a sample in our pages, under Demos, and under Tutorials) ?
>>
>> For example, do you have the same issue even with our Applets from here
>> (latest Pivot-2.0 candidate release): http://ixnay.biz/pivot-tutorials/    ?
>>
>> Bye,
>> Sandro
>>
>> --
>> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2086003.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>>
>

AW: AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
Hey João,

I think it's a pivot issue. I’ve created a simple Applet and a pivot example:

Applet Version (immediate focus works):
http://betrunken.de/media/appletFocusDemo/appletPlainDemo.html

Pivot Version (immediate focus doesn’t work):
http://betrunken.de/media/appletFocusDemo/pivotPlainDemo.html

Try to start typing after reload. I've tested this with Chrome and Firefox. It works only for the applet version.

You can download the source from:
http://betrunken.de/media/appletFocusDemo/demoApplet.jar

I appreciate any hint :)

-----Ursprüngliche Nachricht-----
Von: João Neves [mailto:sevenjp@gmail.com] 
Gesendet: Dienstag, 14. Dezember 2010 16:41
An: user@pivot.apache.org
Betreff: Re: AW: AW: request focus in my pivot applet on page load

Hi,

Correct me if I'm wrong, but from experience some browsers will
probably just stop you from gaining focus on an embedded object. For
instance, Firefox doesn't let you gain focus on an embedded SWF due to
the way external plugins are dealt with in the browser. Since Java
applets need the Java plug-in pretty much in the same way SWF objects
need the Flash plug-in installed, I fear you're out of luck. At least
in the case of Firefox and Flash you can't even lose focus from the
SWF object without clicking outside of it.

Some browsers (like some versions of IE, I believe) may let you do it
with some of the Javascript trickery Greg mentioned above, but
cross-browser... I don't think it's doable right now. AFAIK, the guys
at Mozilla have been trying to get focus management work better with
Flash et al, but I don't think they have anything ready any time soon.

Of course, it's been a while since I last tried to do something like
that (and gave up), so I may not be completely right. :-)

Cheers!

--
João Neves



On Tue, Dec 14, 2010 at 15:28, Felix Eckhardt
<Fe...@starfinanz.de> wrote:
> I've tried these example too. None of them focus an element after page load, which can be controlled immediatily with the keyboard.
>
> I always have to click on them to gain focus. Do you have a different behaviour with your browser?
>
> -----Ursprüngliche Nachricht-----
> Von: Sandro Martini [mailto:sandro.martini@gmail.com]
> Gesendet: Dienstag, 14. Dezember 2010 16:23
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: request focus in my pivot applet on page load
>
>
> Hi,
> have you tried to use the Java deploy Script to load the Applet in the page
> (you can see a sample in our pages, under Demos, and under Tutorials) ?
>
> For example, do you have the same issue even with our Applets from here
> (latest Pivot-2.0 candidate release): http://ixnay.biz/pivot-tutorials/    ?
>
> Bye,
> Sandro
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2086003.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>

Re: AW: AW: request focus in my pivot applet on page load

Posted by João Neves <se...@gmail.com>.
Hi,

Correct me if I'm wrong, but from experience some browsers will
probably just stop you from gaining focus on an embedded object. For
instance, Firefox doesn't let you gain focus on an embedded SWF due to
the way external plugins are dealt with in the browser. Since Java
applets need the Java plug-in pretty much in the same way SWF objects
need the Flash plug-in installed, I fear you're out of luck. At least
in the case of Firefox and Flash you can't even lose focus from the
SWF object without clicking outside of it.

Some browsers (like some versions of IE, I believe) may let you do it
with some of the Javascript trickery Greg mentioned above, but
cross-browser... I don't think it's doable right now. AFAIK, the guys
at Mozilla have been trying to get focus management work better with
Flash et al, but I don't think they have anything ready any time soon.

Of course, it's been a while since I last tried to do something like
that (and gave up), so I may not be completely right. :-)

Cheers!

--
João Neves



On Tue, Dec 14, 2010 at 15:28, Felix Eckhardt
<Fe...@starfinanz.de> wrote:
> I've tried these example too. None of them focus an element after page load, which can be controlled immediatily with the keyboard.
>
> I always have to click on them to gain focus. Do you have a different behaviour with your browser?
>
> -----Ursprüngliche Nachricht-----
> Von: Sandro Martini [mailto:sandro.martini@gmail.com]
> Gesendet: Dienstag, 14. Dezember 2010 16:23
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: request focus in my pivot applet on page load
>
>
> Hi,
> have you tried to use the Java deploy Script to load the Applet in the page
> (you can see a sample in our pages, under Demos, and under Tutorials) ?
>
> For example, do you have the same issue even with our Applets from here
> (latest Pivot-2.0 candidate release): http://ixnay.biz/pivot-tutorials/    ?
>
> Bye,
> Sandro
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2086003.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>

AW: AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
I've tried these example too. None of them focus an element after page load, which can be controlled immediatily with the keyboard. 

I always have to click on them to gain focus. Do you have a different behaviour with your browser?

-----Ursprüngliche Nachricht-----
Von: Sandro Martini [mailto:sandro.martini@gmail.com] 
Gesendet: Dienstag, 14. Dezember 2010 16:23
An: user@pivot.apache.org
Betreff: Re: AW: AW: request focus in my pivot applet on page load


Hi,
have you tried to use the Java deploy Script to load the Applet in the page
(you can see a sample in our pages, under Demos, and under Tutorials) ?

For example, do you have the same issue even with our Applets from here
(latest Pivot-2.0 candidate release): http://ixnay.biz/pivot-tutorials/    ?

Bye,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2086003.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: AW: AW: request focus in my pivot applet on page load

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
have you tried to use the Java deploy Script to load the Applet in the page
(you can see a sample in our pages, under Demos, and under Tutorials) ?

For example, do you have the same issue even with our Applets from here
(latest Pivot-2.0 candidate release): http://ixnay.biz/pivot-tutorials/    ?

Bye,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/request-focus-in-my-pivot-applet-on-page-load-tp2085547p2086003.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

AW: AW: AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
It was a AWT component, but now I changed it to a Swing JTextField. Same
thing - it works! Might be really a povit issue.

 

Take a look at the source, maybe I do something wrong in the
DemoPivot.java.

 

http://betrunken.de/media/appletFocusDemo/demoApplet.jar

 

 

Von: Greg Brown [mailto:gk_brown@verizon.net] 
Gesendet: Dienstag, 14. Dezember 2010 19:25
An: user@pivot.apache.org
Betreff: Re: AW: AW: AW: request focus in my pivot applet on page load

 

Is that a Swing text box or AWT? I wonder if it might have something to
do with the use of lightweight components.

 

On Dec 14, 2010, at 1:13 PM, Felix Eckhardt wrote:





Hey Greg,

 

it's not a JDK issue. I've tested this with a simple Applet and a pivot
example.

 

Applet Version (immediate focus works):

http://betrunken.de/media/appletFocusDemo/appletPlainDemo.html

 

Pivot Version (immediate focus doesn't work):

http://betrunken.de/media/appletFocusDemo/pivotPlainDemo.html

 

Try to start typing after reload. It works only for the applet version.

 

You can download the source from:

http://betrunken.de/media/appletFocusDemo/demoApplet.jar

 

Any clue? Thanks again for your help!

 

 

Von: Greg Brown [mailto:gk_brown@verizon.net] 
Gesendet: Dienstag, 14. Dezember 2010 16:11
An: user@pivot.apache.org
Betreff: Re: AW: AW: request focus in my pivot applet on page load

 

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

 

 

 

 


Re: AW: AW: AW: request focus in my pivot applet on page load

Posted by Greg Brown <gk...@verizon.net>.
Is that a Swing text box or AWT? I wonder if it might have something to do with the use of lightweight components.

On Dec 14, 2010, at 1:13 PM, Felix Eckhardt wrote:

> Hey Greg,
>  
> it’s not a JDK issue. I’ve tested this with a simple Applet and a pivot example.
>  
> Applet Version (immediate focus works):
> http://betrunken.de/media/appletFocusDemo/appletPlainDemo.html
>  
> Pivot Version (immediate focus doesn’t work):
> http://betrunken.de/media/appletFocusDemo/pivotPlainDemo.html
>  
> Try to start typing after reload. It works only for the applet version.
>  
> You can download the source from:
> http://betrunken.de/media/appletFocusDemo/demoApplet.jar
>  
> Any clue? Thanks again for your help!
>  
>  
> Von: Greg Brown [mailto:gk_brown@verizon.net] 
> Gesendet: Dienstag, 14. Dezember 2010 16:11
> An: user@pivot.apache.org
> Betreff: Re: AW: AW: request focus in my pivot applet on page load
>  
> 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
>  
>  
>  


AW: AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
Hey Greg,

 

it's not a JDK issue. I've tested this with a simple Applet and a pivot
example.

 

Applet Version (immediate focus works):

http://betrunken.de/media/appletFocusDemo/appletPlainDemo.html

 

Pivot Version (immediate focus doesn't work):

http://betrunken.de/media/appletFocusDemo/pivotPlainDemo.html

 

Try to start typing after reload. It works only for the applet version.

 

You can download the source from:

http://betrunken.de/media/appletFocusDemo/demoApplet.jar

 

Any clue? Thanks again for your help!

 

 

Von: Greg Brown [mailto:gk_brown@verizon.net] 
Gesendet: Dienstag, 14. Dezember 2010 16:11
An: user@pivot.apache.org
Betreff: Re: AW: AW: request focus in my pivot applet on page load

 

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

 

 

 


Re: AW: AW: request focus in my pivot applet on page load

Posted by Greg Brown <gk...@verizon.net>.
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
>  
>  


AW: AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
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

 

 


Re: AW: request focus in my pivot applet on page load

Posted by Greg Brown <gk...@verizon.net>.
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
>  


AW: request focus in my pivot applet on page load

Posted by Felix Eckhardt <Fe...@starfinanz.de>.
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

 


Re: request focus in my pivot applet on page load

Posted by Greg Brown <gk...@verizon.net>.
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