PDA

View Full Version : What happens to cmd object fields. which are not in a form?


Michael Kastner
Oct 4th, 2005, 10:43 AM
This is getting even more confusing.

I have a command object in session scope in an extended SimpleForm, which holds an id-field. However, the id should not be changed by the user. So there no id field in the form. When I try to save the command object, the id got lost.

Does the binder delete unbound values?

Do I need to put the id in another session object and not the command object?

Sincerely

Michael Kastner

cnelson
Oct 4th, 2005, 01:17 PM
That shouldn't happen. The only way the value of id would be changed after formBackingObject() is called, is to bind a new value from the request (post) parameters.

When using sessionForm(true), the same object instance is used for the lifecycle of the form. Unbound values should be untouched.

Compare your code to some of the samples, or post the code for your JSP, SimpleFormController subclass, and command class.

Cheers,
Christian