Continuing the discussion from Adding conditional parts of models using 'when' statements:
The tailf:display-when statement can be used for conditional display of an object, and it can reference an xpath that points to some other object, or the parent (or some other path relative to the current object).
We have a list of leaf nodes, in which one of the leaf nodes is called “elementType”, and it is an enum that can be (for example) FOO or BAR. The list has other leaf nodes as well. Some of these other leaf nodes should be displayed iff the elementType=FOO, and other leaf nodes should appear iff the elementType=BAR.
We are trying to use tailf:display-when to conditionally display these leaf nodes. However, we cannot reference the xpath of the elementType leaf node, since it is within the object itself. We can reference a parent of the list, but that doesn’t help us, since the elementType value may be different for each element of the list.
In short, how can we conditionally display leaf nodes in a list, if the display is dependent on the value of one of the other leaf nodes in the list? Is it even possible?