I have a field that I only want to show if no value has been entered yet in certain other field (which is a yes/no boolean selection).
I figured this could be done by adding the namespace xmlns:fn="http://www.w3.org/2005/02/xpath-functions" and specifying <xf:bind nodeset="one" relevant="fn:nilled(../other)"/>
I get a popup that says the `nilled' function is not defined.
The status page mentions that the XForms Core Functions are supported (7.6), but Extension functions are not (7.12). Is this what I am running into? Would such support be easy to add? If not, is there a way I can work around this limitation?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Function nilled is not defined because XForms implements XPath 1.0, not 2.0 (http://www.w3.org/TR/2006/REC-xforms-20060314/slice7.html#expr-datatypes).
You can defined new functions in javascript, I will write a document with tips tomorrow.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<xf:bind nodeset="one" relevant="length(../other)"/> also gives a "Function length not found" popup - or isn't that what you meant? Where/how is this function defined?
Is AJAXForms expressive enough to be able to express things like "if an integer below 19 is entered at question foo and question bar is either empty or answered with true" for relevancy of other questions?
Looking forward to an explanation of the extensibility of AJAXForms (or did I miss it?).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a field that I only want to show if no value has been entered yet in certain other field (which is a yes/no boolean selection).
I figured this could be done by adding the namespace xmlns:fn="http://www.w3.org/2005/02/xpath-functions" and specifying <xf:bind nodeset="one" relevant="fn:nilled(../other)"/>
I get a popup that says the `nilled' function is not defined.
The status page mentions that the XForms Core Functions are supported (7.6), but Extension functions are not (7.12). Is this what I am running into? Would such support be easy to add? If not, is there a way I can work around this limitation?
To do this you can type : length(../other) > 0
Function nilled is not defined because XForms implements XPath 1.0, not 2.0 (http://www.w3.org/TR/2006/REC-xforms-20060314/slice7.html#expr-datatypes).
You can defined new functions in javascript, I will write a document with tips tomorrow.
Have you written this tips? I am also trying to call some javascript from XFORM.
It seems there is a complicate solution using the load element: http://en.wikibooks.org/wiki/XForms/Dynamically_Load_JavaScript
I didn't tried it yet; I am not sure AjaxForms handle multiple instances very well, at least it didn't worked in this example: http://en.wikibooks.org/wiki/XForms/Binds_to_many_instances (the only output I got was "Model 1" and after "Model 2"
Thanks
<xf:bind nodeset="one" relevant="length(../other)"/> also gives a "Function length not found" popup - or isn't that what you meant? Where/how is this function defined?
Is AJAXForms expressive enough to be able to express things like "if an integer below 19 is entered at question foo and question bar is either empty or answered with true" for relevancy of other questions?
Looking forward to an explanation of the extensibility of AJAXForms (or did I miss it?).
I worked around this by comparing ../other to the empty string, this seems to work. Is that safe?
About expressivity: seems like this is supported fine and simple: 'relevance="(../foo < 19) and (../bar != 'false')"'.
Sorry, function name is string-length. You can see all XPath functions in http://ajaxforms.sourceforge.net/samples/xpath.html .
The relevance expression is fine.
Happy codding