You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by SreedharGanduri <sr...@gmail.com> on 2011/10/17 13:34:35 UTC

Retain Focus After Ajax Update

Hi,
I have a form, and list of fields in it.
based on input entered in the field i have to update form (remove some
components/ add new ones).
When i update such a field and focus in the next field, i loose the focus
after the ajax update.

Is there a way in wicket in which i can save last focused component and set
the focus back when my model is updated?

Regards
Sree

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Retain-Focus-After-Ajax-Update-tp3911732p3911732.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Retain Focus After Ajax Update

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Oct 17, 2011 at 3:17 PM, vineet semwal
<vi...@gmail.com> wrote:
> use ajaxforcomponentupdatingbehavior for the event onblur/onchange or
> any other depending on your need
>
> set the focus on the formcomponent ajaxrequesttarget.focuscomponent(component)
Or just tell Wicket to not focus after the Ajax response:
ajaxrequesttarget.focuscomponent(null)
This way whatever is focused after the start of the Ajax request will
stay untouched.
>
> On Mon, Oct 17, 2011 at 5:04 PM, SreedharGanduri
> <sr...@gmail.com> wrote:
>> Hi,
>> I have a form, and list of fields in it.
>> based on input entered in the field i have to update form (remove some
>> components/ add new ones).
>> When i update such a field and focus in the next field, i loose the focus
>> after the ajax update.
>>
>> Is there a way in wicket in which i can save last focused component and set
>> the focus back when my model is updated?
>>
>> Regards
>> Sree
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Retain-Focus-After-Ajax-Update-tp3911732p3911732.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Retain Focus After Ajax Update

Posted by vineet semwal <vi...@gmail.com>.
use ajaxforcomponentupdatingbehavior for the event onblur/onchange or
any other depending on your need

set the focus on the formcomponent ajaxrequesttarget.focuscomponent(component)

On Mon, Oct 17, 2011 at 5:04 PM, SreedharGanduri
<sr...@gmail.com> wrote:
> Hi,
> I have a form, and list of fields in it.
> based on input entered in the field i have to update form (remove some
> components/ add new ones).
> When i update such a field and focus in the next field, i loose the focus
> after the ajax update.
>
> Is there a way in wicket in which i can save last focused component and set
> the focus back when my model is updated?
>
> Regards
> Sree
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Retain-Focus-After-Ajax-Update-tp3911732p3911732.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
thank you,

regards,
Vineet Semwal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org