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
Since Orbeon Forms 4 there is:
xxforms-visited
and xxforms-unvisited
eventsYou 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.