Hi everybody,

For the last two days I'm stumbling around the following problem.
I have a BreadCrumbPanel (UserEditPanel) and a form inside this panel.
In the form there are two textfields (Name, ChristianName),  a
DropDownChoice (role), a link (Edit Roles) and two buttons (Save, Cancel).
The idea is that I change something in the textfields, click on the
editRolesLink, a new BreadCrumbPanel is opened, where I can add some
Roles, and when I return to the EditUserPanel the CHANGED values are in
the text fields instead of the ORIGINAL values.

At the moment I am doing the following:
On creation of the UserEditPanel I am assigning the modelObject that is
passed via the constructor to a local variable user.
The form gets as default model a new CompoundPropertyModel with this
local variable:

userEditForm.setDefaultModel(new CompoundPropertyModel<User>(user));

The values of the variable are correctly filled in the TextFields, so
adding my textfields works fine.

If I change something in the Textfields, click the Save Button (which
submits the form) and I set my values to user.getName() etc. the changed
values are taken, so the values of the local user variable are updated.

But when I click on the BreadCrumbPanelLink (which does not submit the
form by default), the original values are restored in the textfields
when I come back to the UserEditPanel.
So I tried to overwrite the onClick Method of the BreadCrumbPanelLink to
start a form processing (which should do nothing except storing changed
values from the model in the local user variable since I did not
overwrite the onSubmit method of the form)
the values of my local user variable are set to null.

One possible solution I was thinking of is that instead of using
userEditForm.add(new TextField("vorname"))
I write
TextField vorname = new Textfield("vorname");
userEditForm.add(vorname);
and in the onClick Method of the BreadCrumbPanelLink I use
user.setVorname(vorname.getInput());

but as far as I understood models correctly, this should not be
necessary. But where is the missing link?

Regards

Wolf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to