Hi guys,
I am sure this is an easy one. How come I am not able to capture the xforms:valid or xforms-invalid events in the example below: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:widget="http://orbeon.org/oxf/xml/widget" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <xforms:model id="fr-form-model"> <xforms:instance id="data"> <root xmlns=""> <item1/> <item2/> </root> </xforms:instance> <xforms:bind nodeset="instance('data')/item1" required="true()"/> <xforms:bind nodeset="instance('data')/item2" required="true()"/> <xforms:action ev:event="xforms-invalid"> <xforms:message>CONTROL INVALID</xforms:message> </xforms:action> <xforms:action ev:event="xxforms-invalid"> <xforms:message>FORM INVALID</xforms:message> </xforms:action> <xforms:action ev:event="xforms-valid"> <xforms:message>CONTROL VALID</xforms:message> </xforms:action> <xforms:action ev:event="xxforms-valid"> <xforms:message>FORM VALID</xforms:message> </xforms:action> </xforms:model> </head> <body> <xforms:input ref="instance('data')/item1"> <xforms:label>Field1</xforms:label> </xforms:input> <xforms:input ref="instance('data')/item2"> <xforms:label>Field2</xforms:label> </xforms:input> </body> </html> -- 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 |
I figured it out, the event handler needs to be withing a group: Solution follows:
<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:widget="http://orbeon.org/oxf/xml/widget" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <xforms:model id="fr-form-model"> <xforms:instance id="data"> <root xmlns=""> <item1/> <item2/> </root> </xforms:instance> <xforms:bind nodeset="instance('data')/item1" required="true()"/> <xforms:bind nodeset="instance('data')/item2" required="true()"/> <xforms:action ev:event="xxforms-invalid"> <xforms:message>FORM INVALID</xforms:message> </xforms:action> <xforms:action ev:event="xxforms-valid"> <xforms:message>FORM VALID</xforms:message> </xforms:action> </xforms:model> </head> <body> <xforms:group ref="instance('data')"> <xforms:action ev:event="xforms-invalid"> <xforms:message>CONTROL INVALID</xforms:message> </xforms:action> <xforms:action ev:event="xforms-valid"> <xforms:message>CONTROL VALID</xforms:message> </xforms:action> <xforms:input ref="item1"> <xforms:label>Field1</xforms:label> </xforms:input> <xforms:input ref="item2"> <xforms:label>Field2</xforms:label> </xforms:input> </xforms:group> </body> </html>
|
Free forum by Nabble | Edit this page |