How can I set the relevant property of an Orbeon element to depends on if a previous element is visited or not?

后端 未结 1 926
刺人心
刺人心 2021-01-28 01:42

I am trying to create in a form some elements that are visible if one specific element has been visited or not. Is it possible?

At this moment, I only can achieve this c

相关标签:
1条回答
  • 2021-01-28 02:19

    Since Orbeon Forms 4 there is:

    • the xxf:visited() function
    • the xxforms-visited and xxforms-unvisited events

    You have to be careful with dependencies when using the function, especially on xf:bind.

    I tried to build a naive example, but it turns out that it doesn't work and I entered an issue.

    Here is a workaround, which requires adding a custom XForms instance:

    <xf:bind id="control-5-bind" ref="control-5" name="control-5"
        relevant="instance('visited') = 'true'"/>
    
    <xf:instance id="visited"><visited/></xf:instance>
    <xf:setvalue event="xxforms-visited"   observer="control-4-control" ref="instance('visited')" value="'true'"/>
    <xf:setvalue event="xxforms-unvisited" observer="control-4-control" ref="instance('visited')" value="'false'"/>
    

    And here is the complete example.

    0 讨论(0)
提交回复
热议问题