PDA

View Full Version : Why do bound form properties not represent dataobject values


tomtom
Oct 3rd, 2005, 09:02 AM
I'm using a Spring formcontroller with a backing dataobject and a freemarker template with the spring macros for the view.
This basically works, but my problem with bound formdata is, that modifications on the backing dataobject by the controller AFTER binding is done, are not represented in the view! Means: the formfield on the screen holds the value that was submitted/set at the moment of binding, not that eventually set after binding by the controller. E.g. if I want to reset some fieds depending on the values of others in the controller logic, this doesn't work - this fields still show the submitted values, while the backing dataobject holds the correct new values.
Till now I havn't found where this kind of caching happens - obviously somewhere in the BindingContext that is used by the freemarker macros?
I don't think this should be the behaviour of the binding functions, since it makes complex formhandling in conjunction with formbinding nearly impossible. Or have I missed something with binding ?
Thanks for any advice

martinl
Oct 3rd, 2005, 05:06 PM
Could you perhaps post code showing when/how this happens?

tomtom
Oct 4th, 2005, 11:33 AM
Sorry for the posting,
after two days of struggle I am ashamed to acknowledge that I found the problem in my controller(un-)logic.
Preparing the code for posting brought some light into my brains, now it works perfectly!
Sorry again.