I cannot seem to capture the xforms:valid or xforms-invalid events.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

I cannot seem to capture the xforms:valid or xforms-invalid events.

npujol73
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
Reply | Threaded
Open this post in threaded view
|

Re: I cannot seem to capture the xforms:valid or xforms-invalid events.

npujol73
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>

npujol73 wrote
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 ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws