Could not clear selection in dynamic dropdown using event

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Could not clear selection in dynamic dropdown using event

Alessandro  Vernet
Administrator
I am following up here to a question (see 1st link below) about resetting the
value of a dropdown with search when the value of another dropdown with
search changes.

Our recommendation is to always put custom XForms in the model, to minimize
the risk of your code being overwritten by Form Builder, or otherwise
causing Form Builder to get "confused". And beyond prototyping, I'd strongly
recommend you put it in a separate file referenced from your properties (see
2nd link below).

Assuming the 2 dropdowns are named `country-1` and `country-1`, the XForms
would do:

    <xf:action event="xforms-value-changed" observer="country-1-control">
        <xf:setvalue ref="//country-2"/>
    </xf:action>

You can see here how the value in the 2nd dropdown is reset when the value
in the 1st one is changed:  reset-on-value-change.gif
<http://discuss.orbeon.com/file/t119778/reset-on-value-change.gif>  .
And here is the source this form:  form.xml
<http://discuss.orbeon.com/file/t119778/form.xml>  .

https://github.com/orbeon/orbeon-forms/issues/4717
https://doc.orbeon.com/form-runner/advanced/custom

I hope this helps,

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1607134316100-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet