Re: updating a property model
use AjaxFormComponentUpdatingBehavior instead -igor On Thu, Jul 21, 2011 at 3:17 PM, wmike1...@gmail.com wrote: > Thanks Igor, > > I've been trying to update the TextField's model myself through an added > AjaxEventBehavior("onchange") event. But I can't seem to access the text > that the user inputs in the TextField. I have: > > textField.add(new AjaxEventBehavior("onchange") > { > @Override > protected void onEvent(AjaxRequestTarget target) > { > system.out.println(textField.getInput()); > } > }); > > This doesnt print out the text that's currently in the text box. How does > the updateModel method in FromComponent know what the inputted text is? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/updating-a-property-model-tp3685186p3685298.html > Sent from the Users forum 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: updating a property model
Thanks Igor, I've been trying to update the TextField's model myself through an added AjaxEventBehavior("onchange") event. But I can't seem to access the text that the user inputs in the TextField. I have: textField.add(new AjaxEventBehavior("onchange") { @Override protected void onEvent(AjaxRequestTarget target) { system.out.println(textField.getInput()); } }); This doesnt print out the text that's currently in the text box. How does the updateModel method in FromComponent know what the inputted text is? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/updating-a-property-model-tp3685186p3685298.html Sent from the Users forum 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: updating a property model
updatemodel of textfield calls model.setobject(value) where model is a property model propertymodel then calls person.setname(value) -igor On Thu, Jul 21, 2011 at 2:41 PM, wmike1...@gmail.com wrote: > From the wicket java docs for property model, it says: > > ...we can create form components that work dynamically on the given model > object. For instance, we could create a text field that updates the name > property of a person like this: > > add(new TextField("myTextField", new PropertyModel(person, "name")); > > My question is: > How does the text field update the name field in the person object? Is it > built in on "onsubmit" or some function inside the TextField class? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/updating-a-property-model-tp3685186p3685186.html > Sent from the Users forum 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 > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
updating a property model
>From the wicket java docs for property model, it says: ...we can create form components that work dynamically on the given model object. For instance, we could create a text field that updates the name property of a person like this: add(new TextField("myTextField", new PropertyModel(person, "name")); My question is: How does the text field update the name field in the person object? Is it built in on "onsubmit" or some function inside the TextField class? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/updating-a-property-model-tp3685186p3685186.html Sent from the Users forum 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