Reputation: 954
I would like to set an attribute dynamically on a view-state like:
<view-state id="any" view="/some.view.xml">
<attribute name="attr" value="#{true ? 'a' : 'b'}"/>
</view-state>
but the value is just taken as plain text. What ways do I have to change 'attr' based on a value in my model.
Upvotes: 0
Views: 761
Reputation: 954
Explanation The tag will not work since it only supports plain strings, not EL expressions.
I found a solution by adding info to the variable temp in an action call and evaluating it in the flow with
<on-entry><set name="viewScope.attr" value="flowScope.temp eq 'X' ? 'aaaa' : 'bbbb'" /></on-entry>
Upvotes: 1