Login  Register

Re: Submit trigger: readonly dependant on the validity of fields

Posted by Alessandro Vernet on Nov 11, 2009; 8:31pm
URL: https://discuss.orbeon.com/Error-when-using-xforms-action-with-xforms-setValue-tp585594p591149.html

Karolin,

On Wed, Nov 11, 2009 at 8:20 AM, Karolin Krieg <[hidden email]> wrote:
> I try to implement a submit trigger which is read-only dependant on the
> validity of fields.
> I dont get it. How do I have to define the readonly attribute of the
> binding?

The issue is that in:

<xforms:bind nodeset="submit-trigger" readonly="not(valid/LastName =
'true' and valid/FirstName = 'true')"/>

The readonly expression is evaluated relative to the node pointed to
by nodeset. So it will look for a submit-trigger/valid/LastName and
submit-trigger/valid/FirstName. Instead, you can write:

<xforms:bind nodeset="submit-trigger"
readonly="not(context()/valid/LastName = 'true' and
context()/valid/FirstName = 'true')"/>

(You could also use ".." instead of "context()", but I find context()
cleaner. It is more a matter of personal preference.)

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet