Question

And there are binds for reacting changes

<xforms:bind nodeset="instance('request')/SOAP-ENV:Body/request">
    <xforms:bind nodeset="request">
    <xforms:bind nodeset="fromDate" type="xforms:date" id="bind_fromDate" />
    <xforms:bind nodeset="toDate" type="xforms:date" id="bind_toDate" />
    <xforms:bind nodeset="hoursperweek" type="xforms:int" id="bind_hoursperweek" />
</xforms:bind>

And also button variable

<xforms:instance id="buttons">
    <buttons>
        <submitbutton />
    </buttons>
</xforms:instance>

And i show the button if all inputs are filled

<xforms:bind nodeset="instance('buttons')">
    <xforms:bind id="bind_savebutton" nodeset="submitbutton" relevant ="
        instance('request')/SOAP-ENV:Body/request/fromDate != '' and
        instance('request')/SOAP-ENV:Body/request/toDate != ''   and
        instance('request')/SOAP-ENV:Body/request/hoursperweek != '' " />

And there is a little form with the inputs in a body tag

<xforms:group ref="instance('request')">
    <xforms:input ref="fromDate" bind="bind_fromDate">
        <xforms:label>Start date</xforms:label>
    </xforms:input>
    <xforms:input ref="toDate" bind="bind_toDate">
        <xforms:label>End date</xforms:label>
    </xforms:input>
    <xforms:input ref="hoursperweek" bind="bind_hoursperweek">
        <xforms:label>Hrs.</xforms:label>
    </xforms:input>
    <xforms:trigger bind="bind_savebutton">
        <xforms:label>Save</xforms:label>
    </xforms:trigger>
</xforms:group>

But how to check with relevant expression, if date is "WronDate" instead of "2013-12-14"? How to see hoursperweek is "non number string" or "23.3" instead of posititive integer e.g "40"? And it is possible check that start date is before than end date? And also bindings in change event instead of "mouse out" event?

Thank you

Was it helpful?

Solution

Here are examples of relevant expressions:

  • Valid date: relevant="string() castable as xs:date"
  • Valid decimal number: relevant="string() castable as xs:decimal"
  • Specific decimal number: relevant=". = 23.3"
  • Compare dates: relevant="$start-date le $end-date" (controls named start-date and end-date)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top