I am using <s:set var="buttonText" value="getText('person.button.add')"/>
in JSTL to use buttonText variable to set text.
Someone tell me how to accomplish this in JSF EL please?
Question asked here IF-ELSE condition in JSF form. Need to know right approach but told to ask as a separate question.
EDITED:
I already added a link above for detail but here is again.
I am using JSTL like in struts2 project
<s:if test="person==null || person.id==null || person.id==''">
<s:set var="buttonText" value="getText('person.button.add')"/>
</s:if>
<s:else>
<s:set var="buttonText" value="getText('person.button.edit')"/>
</s:else>
I want to use same approach in JSF2 but with Expression Language. I am saving value in a variable called buttonText
and accessing it below somewhere like #{buttonText}
. I need solution to how to write variable in EL
and use it. Hope its clear.
I need solution to <s:set var="buttonText" value="getText('person.button.add')"/>
line of code only.
Thanks