jsficefaces-1.8

How can i make outputLabel value change according to a condition?


I have the following outputLabe code in jsf:

<ice:outputLabel value="#{litApp.TipusTramitImportAtorgat}" rendered="#{tipusTramitBB.detailEntity.id == 12}"/>

It appears only if tipusTramitBB.detailEntity.id == 12, if not it must have an other value, is there anyway to do it in this same outputLabel or i have to add an other outputLabel which appears if tipusTramitBB.detailEntity.id != 12


Solution

  • It can be done in one label:

    <ice:outputLabel value="#{tipusTramitBB.detailEntity.id == 12 ? litApp.TipusTramitImportAtorgat : litApp.otherValue}"/>