cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [cforms] Widget states in request-scoped forms
Date Tue, 15 Mar 2005 11:36:29 GMT
Reinhard Poetz wrote:

> Bruno Dumon wrote:
>> On Tue, 2005-03-15 at 09:11 +0100, Reinhard Poetz wrote:
>>> if the widget is invisible, there is no request value any more and 
>>> as the form is not saved in the session, the widget loses its value.
>> Yep, though I'd say that's not a bug but a limitation. If you choose to
>> work stateless, there are some features you loose (for example, value
>> changed events won't do anything meaningful either).
> In particular the value changed event works for me as long as I don't 
> change the widget's state. But you're right, saving the form in the 
> request-scope brings some limitations.

Ah ok, I understand now as I missed the fact that you were using 
stateless forms. Yes, in this context there are some strong limitations 
on what you can use.

> I try to find these limitations and then I can decide together with my 
> customer what we will do.

Yes. We could even add some code in CForms so that a Form knows whether 
it runs in stateful or stateless mode and can then throw meaningful 
exceptions when a statefull feature is used in stateless mode.

> 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.


Sylvain Wallez                        Anyware Technologies  
Apache Software Foundation Member     Research & Technology Director

View raw message