Hi Kent,

I would like to use the code snippet you're providing, but I don't fully
understand it... Why are you creating an AjaxLink and then setting the focus
on the TextField within the onClick() method of the AjaxLink?

Thanks so much,

Cristina



Kent Tong wrote:
> 
> 
> 
> Doug Leeper wrote:
>> 
>> I know this is probably one of the most trivial things to do...but I am
>> stumped.  No example that I found on the Wicket example site has shown
>> this.  I know that AjaxRequestTarget#focusComponent plays a part in this
>> but not sure how.  Could someone post a quick code snippet or place on
>> the Wiki on how do to this in 1.3?
>> Thanks
>> 
> 
> For example, your TextField is f1, then:
> 
> <pre>
>               AjaxLink link = new AjaxLink("link") {
>                       public void onClick(AjaxRequestTarget target) {
>                               target.addComponent(...);
>                               target.focusComponent(f1);
>                       }
>               };
> </pre>
> 

-- 
View this message in context: 
http://www.nabble.com/Setting-focus-to-a-TextField-tf4490766.html#a12948392
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to