The model objects are only updated after form submission and submission will only happen if successful validation has occurred.
If you are expecting to copy values from one field to another without performing form submission then you can't extract the values from the model objects. I think what you might be looking for is the String getRawInput() method on FormComponent which *I believe* returns the value that is currently in the TextField. >-----Original Message----- >From: William Speirs [mailto:wspe...@apache.org] >Sent: Thursday, 13 December 2012 1:51 PM >To: users >Subject: FormComponentPanel & onchange Events > >I've created a FormComponentPanel with 2 text boxes: A & B. I've add this >new FormComponentPanel to my page twice: 1 & 2. What I'd like to have >happen is when I change the value of 1A I want that same value copied into >2A. > >I call setOutputMarkupId to true on 1A, 1B, 2A, and 2B. I setup >an AjaxEventBehavior on panel 1 and it fires as expected. However, inside >of the onEvent method all of the model instances I try to obtain are always >null (therefore preventing me from setting 2A). I've tried getting the >form's model object, the model object for panel 1, and even the model >object for A1... everything is always null. > >Is there some method of FormComponentPanel that I'm not overriding that I >need to be? Any thoughts on how to make this work? > >Thanks... > >Bill- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org