Reinhard Poetz wrote:
Sylvain Wallez wrote:
Another idea I had is, that I could work on making the form object serializable and save the state in a hidden form field. The price to pay would be increased network traffic but the advantage of a stateless presentation layer wouldn't get lost. Hmmm the more I think about it the more I like this idea .... wdot?
You should have a look at the XMLAdapter class in o.a.c.form.util. It does handles form serialization/deserialization in XML. AFAIK it doesn't keep state, but this could easily be added.
Thanks for the pointer! This should be very helpful, if I go this way.
Is there anything else that is necessary to _completly_ describe the state of a form, except the value and the "visibility state"? (events, validation errors, ...?)
Events are inherently transient (i.e. they are produced and consumed as part of the processing of a request). Validation errors are part of the global state of a form, as non-active widgets will loose their value and any validation as they don't read their value on the request.
You also have to include <fd:repeater-size> in your form template so that the size of repeaters is transmitted back and forth as a hidden input.
Sylvain
-- Sylvain Wallez Anyware Technologies http://apache.org/~sylvain http://anyware-tech.com Apache Software Foundation Member Research & Technology Director
