cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Vera <vmv...@gmail.com>
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>
<fd:field id="RF01">
	<fd:datatype base="long"/>
</fd:field>
<fd:calculatedfield id="VC01">
	<fd:datatype base="double"/>
	<fd:value eval="(VF01 + RF01) / 100"/>
</fd:calculatedfield>


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

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: http://www.nabble.com/Not-Required-CalculatedField-in-CForms-tp19275733p19275733.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Mime
View raw message