Gregory Blajian wrote:

In the ATM example the pin is validated but it is done in
the XPL vice through a bind property.  I apologize if this question has
been asked before but I didn't see it in the archive.

The "trick" here is that when an element is validated (because there is a type, constraint, or required attribute on a bind expression pointing to that element in the XForms model), the XForms engine adds an xxforms:valid="true|false" attribute to the element. You have access to this attribute in your action, MVC model, and epilogue (i.e. everywhere you have access to the XForms instance).


In the ATM example, if you want the validation to be performed with a model item property, you would add this to the XForms model:

    <xforms:bind nodeset="/form/pin" constraint=". = '42'"/>

And the enter-pin-action.xsl would look for the xxforms:valid attribute:

    <valid xsl:version="2.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
            xmlns:xxforms="http://orbeon.org/oxf/xml/xforms";>
        <xsl:value-of
            select="not(/form/[EMAIL PROTECTED]:valid = 'false'])"/>
    </valid>

Alex



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to