Re: TextField not binding PropertyModel
Hi Per, You are spot on! Thanks. I'm creating a add/edit form and what I was initialising the event object in two places: public class CreateEvent extends Panel { private Event event = new Event(); ... ... public GenericEventCreatePanel(String id, Long eventId){ super(id, new LoadableEventModel(eventId)); Event eventFromDB = (Event) this.getDefaultModel().getObject(); if ( eventFromDB == null ){ event = new Event(EventDetailValues); }else{ event = eventFromDB; } I will modify it so that event object is initialized once and if it is an event for edit (LoadableEventModel finds the event in DB), then I will copy each field individually. Thanks for your help. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-binding-TextField-tp3527074p3527217.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: TextField not binding PropertyModel
Am 16.05.2011 20:48, schrieb lucast: Dear Forum, I am trying to bind the field event.title to the eventTitleTextField in a form in the following manner: TextField eventTitleTextField = new TextField("eventTitle", new PropertyModel(event, "title")); "title" is a field of event object. When processing the form, after having filled the eventTitleTextField, event.getTitle() returns null. When analysing the content of the above eventTitleTextField while debugging on Eclipse, the eventTitleTextField.data contains an instance of event object and the title field is populated. However, the original event.title field is still null. Why is it not binding the TextField to the variable? what am I missing here? Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/TextField-not-binding-PropertyModel-tp3527074p3527074.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 How do you assign event? Are there multiple new Event() somewhere? I would bet that you assign data to one instance and check data in another one. But we need some code here. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
TextField not binding PropertyModel
Dear Forum, I am trying to bind the field event.title to the eventTitleTextField in a form in the following manner: TextField eventTitleTextField = new TextField("eventTitle", new PropertyModel(event, "title")); "title" is a field of event object. When processing the form, after having filled the eventTitleTextField, event.getTitle() returns null. When analysing the content of the above eventTitleTextField while debugging on Eclipse, the eventTitleTextField.data contains an instance of event object and the title field is populated. However, the original event.title field is still null. Why is it not binding the TextField to the variable? what am I missing here? Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/TextField-not-binding-PropertyModel-tp3527074p3527074.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