Search code examples
jsfconditional-statementsopenfaces

can open faces row condition used for display checking?


Can i use open faces row condition to check output result?i tried to use in my code like this but it prints all the values regardless of condition

<o:row condition="#{item.errorCode==5}" >
   <o:cell>
       <h:outputText value="Fail"  />
   </o:cell>
</o:row>
<o:row condition="#{item.errorCode==3}" >
   <o:cell>
       <h:outputText value="Success"  />
   </o:cell>
</o:row>

is there any other way to do this?thanks


Solution

  • You can use the validation in the rendered attribute of the to control the display.

    <o:row>
        <o:cell>
            <h:outputText value="Fail" rendered="#{item.errorCode==5}"  />
            <h:outputText value="Success" rendered="#{item.errorCode==3}" />
        </o:cell>
    </o:row>