cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33740] - Validation for aggregate fields
Date Tue, 22 Mar 2005 07:09:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33740>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33740


sdoolan@travelthere.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sdoolan@travelthere.com




------- Additional Comments From sdoolan@travelthere.com  2005-03-22 08:09 -------
Hi,

I also have a problem with validation on aggregate fields, and it might be
related to this bug.

When I put a validation error on a sub-widget inside an aggregate field, the
fi:validation-message appears in the output from the CForms transformer in the
sub-widget, ie. id="date.year". I would expect the CForms to redisplay the same
page with the validation error using the form.showForm() flowscript, but it
exits the showForm() loop, and it appears that there were no validation errors.

When I set the validation error on the actual aggregrate field, ie. id="date",
the showForm() loop redisplays the page indicating there was a validation error,
but the error is not returned in the output from the CForms transformer.

This is an example of the form definition:

<fd:aggregatefield id="date" required="true"> 
	...
	<fd:widgets>
		<fd:field id="day" required="true">
			<fd:datatype base="integer"/>
			...
		</fd:field>
		<fd:field id="month" required="true">
			<fd:datatype base="integer"/>
			...
		</fd:field>
		<fd:field id="year" required="true">
			<fd:datatype base="integer"/>
			...
		</fd:field>
	</fd:widgets>
	<fd:validation>
		<fd:javascript>
			...
		</fd:javascript>
	</fd:validation>
</fd:aggregatefield>

This is an example of the binding:

<fb:value id="date" path="date"/>

And this is an example of the template:

<ft:aggregate-widget id="date">
	<ft:widget id="day"/>
	<ft:widget id="month"/>
	<ft:widget id="year"/>
</ft:aggregate-widget>

I found that if I added another ft:widget to the template for the aggregate
field itself, the validation error set on the aggregate widget appeared in a
fi:aggregate-field element in the output from the CForms transformer.

<ft:widget id="date"/>

So I have one error, and one possible solution to the original bug description -
the error is that errors in sub-widgets of aggregate fields are being ignored by
showForm(), and the solution to the original bug is to add <ft:widget
id="date"/> to your template to generate the fi:aggregate-field xml for the
aggregate widget.

Regards

Steven Doolan

PS. I am using Cocoon 2.1.6 on Windows XP using Apache Tomcat 5.0.24.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message