-
1. Re: Change Text Color depending upon text
asimshaikh1 Nov 25, 2016 2:12 AM (in response to asimshaikh1)more precisely add third condition to EL expression.
<h:outputText value="#{event.eventStatusDesc}"
style="#{event.eventStatusDesc eq 'Completed' ? 'color: red;font-weight: bold;':'color: black;'}" />
-
2. Re: Change Text Color depending upon text
michpetrov Nov 25, 2016 7:31 AM (in response to asimshaikh1)Since you're using a variable from a bean why not figure out the style in the bean as well? Or you could just use CSS classes with name derived from the string you're displaying. If you really want to use EL you can nest the conditions but that's going to be confusing to work with.
-
3. Re: Change Text Color depending upon text
asimshaikh1 Nov 28, 2016 4:35 AM (in response to asimshaikh1)Thank you again. The issue has been resolved by below code. Its just syntax that I am missing.
style="#{event.eventStatusDesc eq 'Completed' ? 'color: green;font-weight: bold;' : (event.eventStatusDesc eq 'Rescheduled till Further Notice' ? 'color: blue;font-weight: bold;' : 'color: black;')