how to set focus in a listview coponent

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to set focus in a listview coponent

sri357
Hi,

I have a table with a list view displaying one textbox in one column,and next column is again a listview displaying textboxes depending on its size.The problem i am facing here is,whenever i enter some text in the second textbox,im implementing a ajax onblurr event to format text and refreshing the container holding the second listview to make the changes visible.After refreshing container i am unable to view cursor in the page. I want to set focus either in the first textbox or textbox next to the one where i entered data in the second list view.Can anyone help me out with this.
Reply | Threaded
Open this post in threaded view
|

Re: how to set focus in a listview coponent

Martin Grigorov-4
org.apache.wicket.ajax.AjaxRequestTarget.focusComponent(firstTextField)

On Tue, Jul 12, 2011 at 2:53 PM, sri357 <[hidden email]> wrote:

> Hi,
>
> I have a table with a list view displaying one textbox in one column,and
> next column is again a listview displaying textboxes depending on its
> size.The problem i am facing here is,whenever i enter some text in the
> second textbox,im implementing a ajax onblurr event to format text and
> refreshing the container holding the second listview to make the changes
> visible.After refreshing container i am unable to view cursor in the page. I
> want to set focus either in the first textbox or textbox next to the one
> where i entered data in the second list view.Can anyone help me out with
> this.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-set-focus-in-a-listview-coponent-tp3662151p3662151.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how to set focus in a listview coponent

sri357
I am able to set focus using target.focusComponet() on an event,but how to set focus in a textfield without using any event.
Reply | Threaded
Open this post in threaded view
|

Re: how to set focus in a listview coponent

Martin Grigorov-4
JavaScript: Wicket.$('firstTextFieldId').focus();

On Tue, Jul 12, 2011 at 6:08 PM, sri357 <[hidden email]> wrote:

> I am able to set focus using target.focusComponet() on an event,but how to
> set focus in a textfield without using any event.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-set-focus-in-a-listview-coponent-tp3662151p3662730.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: how to set focus in a listview coponent

sri357
Thank you very much,i could now sucessfully set focus,but dont we have any direct componet.setFocus() type of methods to set focus.
Reply | Threaded
Open this post in threaded view
|

Re: how to set focus in a listview coponent

Martin Grigorov-4
On Wed, Jul 13, 2011 at 1:16 PM, sri357 <[hidden email]> wrote:
> Thank you very much,i could now sucessfully set focus,but dont we have any
> direct componet.setFocus() type of methods to set focus.
No.
But it is quite easy to create a Behavior that does it.
component.add(new FocusBehavior());

>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-set-focus-in-a-listview-coponent-tp3662151p3664668.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]