logo       
Google Custom Search
    AddThis Social Bookmark Button

RE: assert extension: msg#00012

Subject: RE: assert extension
Further to my question below....

I've now learned that extension methods that contain ExpressionContext in their 
method signature are only called at form load time. 

Methods like ChibaExtensionFunctions.match(String,String,String) are called 
every validate/calculate while methods like 
ChibaExtensionFunctions.calculate(ExpressionContext,String) are only called 
when the form is first loaded.

Does anyone know of a way to get methods like 
ChibaExtensionFunctions.calculate(ExpressionContext,String) called on every 
validate/calculate or is this way outside the spec?

Thanks in advance for any help.

Cheers,
Will

-----Original Message-----
From: chiba-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
[mailto:chiba-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx]On
 Behalf Of William
Boyd
Sent: Monday, February 21, 2005 2:21 PM
To: chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
Subject: [Chiba-developer] assert extension


Hello,

I'd like to be able change a fields xforms:required and xforms:relevant state 
base on the value of another field. This seems easy and in fact I have it 
working in the attached addressWorks.xhtml example. With this example, if the 
select equals 'home' then the phone field is required. If the select equals 
'fax' then the phone field is not relevant.

The hard part is in the addressNotWorking.xhtml example. In this example I am 
attempting to use an extension called assertBoolean to evaluate an instance 
attribute from the bind. My extension does get called and works when the form 
is first loaded but is never called again. Is it possible to get this second 
example to behave like the first?

My reason for my madness is that in our system I can modify the instance at 
runtime. To modify the bind I would have to generate a new XForm and we 
currently don't generate XForms at runtime and don't really want to.

To set up the extension you'll need to:
1. Compile SfExtensionFunctions
2. Add this to org\chiba\xml\xforms\config\default.xml:
<function namespace="http://www.cucbc.com/2004/01/stdform"; name="assertBoolean" 
class="com.cucbc.stdforms.xml.SfExtensionFunctions" />
3. change xml:base as required in the attached xforms documents

PS: I'm still working with Chiba 0.9.8 code base.

Any suggestion would be appreciated.

Thanks,
William Boyd


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>