You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jammyjohn <jc...@yahoo.com> on 2010/06/08 22:58:19 UTC

How to get a value of textfield on onBlur event..

Hi,

How to get the value of the textfield on onBlur event? The below code 
always prints null for shipIdTf.getInput()

final TextField shipIdTf =  new TextField("ship.id");		
		shipIdTf.setOutputMarkupId(true);
		mawbForm.add(shipIdTf);		
	
		
		shipIdTf.add(new AjaxEventBehavior("onBlur"){			
			private static final long serialVersionUID = 1L;			
			@Override
			protected void onEvent(AjaxRequestTarget target) {
				System.out.println("Event is triggered");
				System.out.println("The input value is " + shipIdTf.getInput())
			}
			
        });

Please suggest.

Thanks for your time.
Jamuna.
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-a-value-of-textfield-on-onBlur-event-tp2248027p2248027.html
Sent from the Wicket - User 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: How to get a value of textfield on onBlur event..

Posted by Fausto Argeni Bencosme Doñe <ar...@gmail.com>.
Use  OnChangeAjaxBehavior subclass.

Fausto Argeni Bencosme Doñe.
:D


On Tue, Jun 8, 2010 at 9:42 PM, jammyjohn <jc...@yahoo.com> wrote:

>
> Thanks for your reply. It worked. But I ran into another problem.
>
> Instead of getting the value of textfield value getInput(), I tried getting
> it from my model as dtoModel.getObject().getShipId().
>
> This gives me the correct value(the value entered in the text field) for
> the
> first time. If I change the value in the text field, the model always gives
> me the first value but not the recent value that I changed.
>
> Looks like my model is not updated? Please suggest.
>
> I would appreciate your help in this regard.
>
> Thanks & Regards,
> C. Jamuna
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-get-a-value-of-textfield-on-onBlur-event-tp2248027p2248223.html
> Sent from the Wicket - User 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: How to get a value of textfield on onBlur event..

Posted by jammyjohn <jc...@yahoo.com>.
Thanks for your reply. It worked. But I ran into another problem.

Instead of getting the value of textfield value getInput(), I tried getting
it from my model as dtoModel.getObject().getShipId().

This gives me the correct value(the value entered in the text field) for the
first time. If I change the value in the text field, the model always gives
me the first value but not the recent value that I changed.

Looks like my model is not updated? Please suggest.

I would appreciate your help in this regard.

Thanks & Regards,
C. Jamuna








-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-get-a-value-of-textfield-on-onBlur-event-tp2248027p2248223.html
Sent from the Wicket - User 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: How to get a value of textfield on onBlur event..

Posted by Gerolf Seitz <ge...@gmail.com>.
 AjaxFormComponentUpdatingBehavior might be what you want.

Regards,
  Gerolf

On Tue, Jun 8, 2010 at 10:58 PM, jammyjohn <jc...@yahoo.com> wrote:

>
> Hi,
>
> How to get the value of the textfield on onBlur event? The below code
> always prints null for shipIdTf.getInput()
>
> final TextField shipIdTf =  new TextField("ship.id");
>                shipIdTf.setOutputMarkupId(true);
>                mawbForm.add(shipIdTf);
>
>
>                shipIdTf.add(new AjaxEventBehavior("onBlur"){
>                        private static final long serialVersionUID = 1L;
>                        @Override
>                        protected void onEvent(AjaxRequestTarget target) {
>                                System.out.println("Event is triggered");
>                                System.out.println("The input value is " +
> shipIdTf.getInput())
>                        }
>
>        });
>
> Please suggest.
>
> Thanks for your time.
> Jamuna.
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-get-a-value-of-textfield-on-onBlur-event-tp2248027p2248027.html
> Sent from the Wicket - User 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
>
>