cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: [cforms] Clear validation error on a widget?
Date Wed, 14 Apr 2004 17:37:17 GMT

On Apr 14, 2004, at 10:02 AM, Joerg Heinicke wrote:

> On 14.04.2004 18:36, Mark Lundquist wrote:
>> Hi,
>> I have a repeater whose rows contain:
>>     • a text field that notionally is required, but is not declared 
>> as such in the definition (see below)
>>     • a "delete me" booleanfield.
>> The field is not @required="true", because if the user clicks to add 
>> a row and then decides they don't want it after all, they must check 
>> the "delete me" box on that row and submit the form.  So this state 
>> (text field empty, box checked) must be valid.
>> So I'm doing a check in the form.onValidate handler.  I call 
>> setValidationError() on the text widget in the error case (field 
>> empty, "delete me" not checked), and that works fine.
>> But I also need the ability to clear the validation error if the 
>> field is empty and the "delete me" box is checked.  How do I do this?
>> I tried setValidationError (null), but that didn't do the trick.
>> Any ideas?
>
> I might be wrong, but I'm nearly sure I have both working: required 
> fields in a repeater, with delete me checkboxes and 
> setValidationError(null). I'm using still 2.1.4 Woody, so part I might 
> be caused by actions causing validation, but Sylvain has fixed this 
> yesterday, so this should work too.

Thanks... I'll try building from a fresh snapshot, and we'll see what 
happens.

Are you declaring your required field @required="true"?

One of the bad behaviors I'm seeing right now is that after I call 
setValidationError (null) in the flowscript, I get output something 
like this from <fi:valdatation-errors>:

	Your form had the following errors:
		• null
	Please fix and resubmit

Any idea about that?

mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message