I don't know if this has anything to do... but make sure class StreetAddress implements equals
On Thu, Feb 14, 2013 at 11:55 AM, Lucio Crusca <[email protected]> wrote: > Hello *, > > I have a FormComponentPanel derived class that uses a DropDownChoice with a > ChoiceRenderer. The DropDownChoice id matches the field name in my model > class > and I use a CompountPropertyModel wrapping my model instance for the > component. > > Code snippets: > > class StreetAddress > ... > private String address; > @ManyToOne > private District idDistrict; > > ... usual getters and setters > > > class StreetAddressFormCP extends FormComponentPanel<StreetAddress> > ... > super(myCompountPropertyModel)); > add(new TextField("address")); > add(new DropDownChoice("idDistrict", ...)); > > class StreetAddressForm extends Form<StreetAddress> > ... > super(myCompoundPropertyModel); > add(new StreetAddressFormCP(myCompoundPropertyModel)); > ... > > > All seems to work except that when I edit an address and change district in > the dropdown, my onSubmit receives a model with the old value for > idDistrict > (but new edited value for address), so that part of the edit is lost. > > Isn't DropDownChoice supposed to always update the model when the user > selects > an item/submits the form? > > P.S. onSubmit overridden on a Button behaves like stated above, while > onSubmit > overridden on the Form behaves differently: it receives a model with a null > target... > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Regards - Ernesto Reinaldo Barreiro Antilia Soft http://antiliasoft.com/ <http://antiliasoft.com/antilia>
