cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Vera <>
Subject Not Required CalculatedField in CForms
Date Tue, 02 Sep 2008 18:26:55 GMT

I'm working in a forms application, with some calculated fields.
The problem is, when i put a calculated field with "not required" dependents
fields, i get an exception because the expression search for the value of
the second argument in the expression and this is not yet loaded.

For example:

<fd:field id="VF01">
	<fd:datatype base="long"/>
<fd:field id="RF01">
	<fd:datatype base="long"/>
<fd:calculatedfield id="VC01">
	<fd:datatype base="double"/>
	<fd:value eval="(VF01 + RF01) / 100"/>

When the a value is assigned to VF01, a change event is fired and a
recalculation is executed. But the value in RF01 doesn't have a value yet.
So a ExpressionException: Unknown variable RF01 at line 1, column 9 is

if the RF01 is declared like a "required", then this work. But what i need,
is that if i don't fill one of this fields, then don't make the calculus.

I checked the ExpressionContextImpl and a CannotYetResolveWarning  is
throwed when: the widget's value is null and the field is required or
calculated. I changed the validation to throw this exception when the value
is null, but i don't know if there is a better or simple way to do this.  

any suggestion?


View this message in context:
Sent from the Cocoon - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message