RRZ Europe
RRZ Europe

Reputation: 954

Set Spring Webflow attribute dynamically

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

Answers (1)

RRZ Europe
RRZ Europe

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

Related Questions