Hi Erik,
We are using version 4.10.2.201512022157, here is a simple form below, i have added the code you sent that clears the values when the xforms-disabled event fires. <xf:setvalue observer="fr-form-group" ev:event="xforms-disabled" ref="event('xxf:binding')"/> In order to reproduce the issue, tick the checkbox and then answer the question to see a result explanation text, then untick the box, this fires the code you sent that clears the dropdown box value. Re-tick the box and notice that the content of the explanantion controls has now gone. However if you change the Explanation controls to TextOutput controls the text remains. If you remove the code you sent, you will see the original issue that this thread was started for, unticking the checkbox leaves the result control showing because the value of the dropdown is not cleared, putting the form in an inconsistent state. <xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude" xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:exf="http://www.exforms.org/exf/1-0" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:saxon="http://saxon.sf.net/" xmlns:sql="http://orbeon.org/oxf/xml/sql" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fb="http://orbeon.org/oxf/xml/form-builder"> <xh:head> <xh:title>Visibility Logic Test</xh:title> <xf:model id="fr-form-model" xxf:expose-xpath-types="true"> <xf:setvalue observer="fr-form-group" ev:event="xforms-disabled" ref="event('xxf:binding')"/> <xf:instance id="fr-form-instance" xxf:exclude-result-prefixes="#all"> <form> <section-1> <GeekTest/> <GeekExplaination/> <GeekQuestion/> <SuccessGeek/> <FailureNotGeek/> <UnknownGeek/> </section-1> </form> </xf:instance> <xf:bind id="fr-form-binds" ref="instance('fr-form-instance')"> <xf:bind id="section-1-bind" name="section-1" ref="section-1"> <xf:bind id="GeekTest-bind" ref="GeekTest" name="GeekTest" type="xf:boolean"/> <xf:bind id="GeekExplaination-bind" ref="GeekExplaination" name="GeekExplaination" relevant="$GeekTest = true()"/> <xf:bind id="GeekQuestion-bind" ref="GeekQuestion" name="GeekQuestion" relevant="$GeekTest = true()"/> <xf:bind id="FailureNotGeek-bind" ref="FailureNotGeek" name="FailureNotGeek" relevant="$GeekQuestion = '1' or $GeekQuestion = '2'"/> <xf:bind id="UnknownGeek-bind" ref="UnknownGeek" name="UnknownGeek" relevant="$GeekQuestion = '4'"/> <xf:bind id="SuccessGeek-bind" ref="SuccessGeek" name="SuccessGeek" relevant="$GeekQuestion = '3'"/> </xf:bind> </xf:bind> <xf:instance xxf:readonly="true" id="fr-form-metadata" xxf:exclude-result-prefixes="#all"> <metadata> <application-name>TestApp</application-name> <form-name>VisibilityLogicTest</form-name> <title xml:lang="en">Visibility Logic Test</title> <description xml:lang="en"/> <singleton>false</singleton> </metadata> </xf:instance> <xf:instance id="fr-form-attachments" xxf:exclude-result-prefixes="#all"> <attachments> <css mediatype="text/css" filename="" size=""/> <pdf mediatype="application/pdf" filename="" size=""/> </attachments> </xf:instance> <xf:instance id="fr-form-resources" xxf:readonly="false" xxf:exclude-result-prefixes="#all"> <resources> <resource xml:lang="en"> <GeekTest> <label>I would like to take the Geek test!</label> <hint/> </GeekTest> <GeekExplaination> <text><div>EXPLANATION: In order to pass the Geek test you need to answer a simple question which is shown below</div></text> </GeekExplaination> <GeekQuestion> <label>Which one of the following activities would you prefer to do in your spare time?</label> <hint/> <item> <label>Read a Book</label> <value>1</value> </item> <item> <label>Watch TV</label> <value>2</value> </item> <item> <label>Write some Code!</label> <value>3</value> </item> <item> <label>I prefer not to Say</label> <value>4</value> </item> </GeekQuestion> <SuccessGeek> <text><div>EXPLANATION: Congratulations, you have passed the Geek test!</div></text> </SuccessGeek> <FailureNotGeek> <text><div>EXPLANATION: Sorry you have failed the Geek test!</div></text> </FailureNotGeek> <UnknownGeek> <text><div>EXPLANATION: Ok, fair enough!</div></text> </UnknownGeek> <section-1> <label>Main Section</label> </section-1> </resource> </resources> </xf:instance> <xf:instance id="fr-service-request-instance" xxf:exclude-result-prefixes="#all"> <request/> </xf:instance> <xf:instance id="fr-service-response-instance" xxf:exclude-result-prefixes="#all"> <response/> </xf:instance> </xf:model> </xh:head> <xh:body> <fr:view> <fr:body xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xbl="http://www.w3.org/ns/xbl"> <fr:section id="section-1-control" bind="section-1-bind"> <xf:label ref="$form-resources/section-1/label"/> <fr:grid> <xh:tr> <xh:td> <xf:input id="GeekTest-control" bind="GeekTest-bind"> <xf:label ref="$form-resources/GeekTest/label"/> <xf:hint ref="$form-resources/GeekTest/hint"/> <xf:alert ref="$fr-resources/detail/labels/alert"/> </xf:input> </xh:td> <xh:td/> </xh:tr> </fr:grid> <fr:grid> <xh:tr> <xh:td> <fr:explanation xmlns:xxbl="http://orbeon.org/oxf/xml/xbl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="GeekExplaination-control" bind="GeekExplaination-bind"> <xf:alert ref="$fr-resources/detail/labels/alert"/> <fr:text ref="$form-resources/GeekExplaination/text" mediatype="text/html"/> </fr:explanation> </xh:td> </xh:tr> <xh:tr> <xh:td> <xf:select1 id="GeekQuestion-control" bind="GeekQuestion-bind" appearance="dropdown"> <xf:label ref="$form-resources/GeekQuestion/label"/> <xf:hint ref="$form-resources/GeekQuestion/hint"/> <xf:alert ref="$fr-resources/detail/labels/alert"/> <xf:itemset ref="$form-resources/GeekQuestion/item"> <xf:label ref="label"/> <xf:value ref="value"/> </xf:itemset> </xf:select1> </xh:td> </xh:tr> <xh:tr> <xh:td> <fr:explanation xmlns:xxbl="http://orbeon.org/oxf/xml/xbl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="SuccessGeek-control" bind="SuccessGeek-bind"> <xf:alert ref="$fr-resources/detail/labels/alert"/> <fr:text ref="$form-resources/SuccessGeek/text" mediatype="text/html"/> </fr:explanation> </xh:td> </xh:tr> <xh:tr> <xh:td> <fr:explanation xmlns:xxbl="http://orbeon.org/oxf/xml/xbl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="FailureNotGeek-control" bind="FailureNotGeek-bind"> <xf:alert ref="$fr-resources/detail/labels/alert"/> <fr:text ref="$form-resources/FailureNotGeek/text" mediatype="text/html"/> </fr:explanation> </xh:td> </xh:tr> <xh:tr> <xh:td> <fr:explanation xmlns:xxbl="http://orbeon.org/oxf/xml/xbl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="UnknownGeek-control" bind="UnknownGeek-bind"> <xf:alert ref="$fr-resources/detail/labels/alert"/> <fr:text ref="$form-resources/UnknownGeek/text" mediatype="text/html"/> </fr:explanation> </xh:td> </xh:tr> </fr:grid> </fr:section> </fr:body> </fr:view> </xh:body> </xh:html> |
Administrator
|
I tried to reproduce this, but I don't think I do. See the attached image, which I get after I clear the checkbox, check it again, and select something again: the explanation is there as in the original case. So I am not sure what's different! I tried with 4.10.2 and our latest master and am getting the same result.
|
This post was updated on .
Thats strange, when i tick the box, then select an option which shows the explanation, then untick, then select the same option again (so the same explanation shows again) the explanation is empty.
Ill try upgrading and see if it works. |
Free forum by Nabble | Edit this page |