cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philipp Zerelles <>
Subject CForms problem
Date Sat, 20 Jan 2007 16:14:42 GMT
I found a problem in CForms that seems to be known already but not really addressed.

When I have a CForm and go to a completely different page from there and then come back using
the continuation, 
my form input fields are cleared because there are no request-parameters and a null value
is treated as if the request-parameter was set empty. 
The real problem with this is that the validation is triggered as well and errors may be shown
although there are none.

This is the part in org.apache.cocoon.forms.formmodel.Field that is responsible for that:

   // FIXME: Should we consider only non-null values?
   // Although distinguishing an empty value (input present but blank) from a null value
    // (input not present in the form) is possible, this distinction is not possible for
   // several other kinds of widgets such as BooleanField or MultiValueField. So we keep
   // it consistent with other widgets.
   //if (newEnteredValue != null) {

Are the values the form had when last posted not still stored in the widget? After a failed
submit I mean. 
This code always will overwrite them with empty values if coming back without request-parameters.

What do you think about that?

View raw message