Rahul Agarwal wrote:
I know 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. I can access this attribute anywhere I have access to the XForms instance.
My question is - Is there any way to know which particular validation/bind expression (constraint, required or anything else) made the element invalid? My intention is to display appropriate <xforms:alert> message which makes user understand exactly what went wrong. User is not convinced to see all <xforms:alert> messages associated with an element while only one of the many possible constraints is failed.

Rahul,

Make sure you have an "id" attribute on your "bind" elements, for instance:

    <xforms:bind id="a" nodeset="/instance" constraint="false()"/>

Then when validation fails, an "xxforms:invalid-bind-ids" attribute is added in addition to the "xxforms:valid" attribute. The value of this element is the id of the "bind" that failed. For instance:

    <instance xxforms:invalid-bind-ids="a" xxforms:valid="false"/>

Alex


-------------------------------------------------------
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://productguide.itmanagersjournal.com/
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to