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

2010-06-08 Thread jammyjohn

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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

2010-06-08 Thread Gerolf Seitz
 AjaxFormComponentUpdatingBehavior might be what you want.

Regards,
  Gerolf

On Tue, Jun 8, 2010 at 10:58 PM, jammyjohn jchinnas...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




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

2010-06-08 Thread jammyjohn

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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

2010-06-08 Thread Fausto Argeni Bencosme Doñe
Use  OnChangeAjaxBehavior subclass.

Fausto Argeni Bencosme Doñe.
:D


On Tue, Jun 8, 2010 at 9:42 PM, jammyjohn jchinnas...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org