Using multiple boolean conditions in EL expression

后端 未结 2 1380
礼貌的吻别
礼貌的吻别 2021-01-23 09:03

I would like to know how can I combine multiple boolean coniditions in EL. I have following example and it is not working.



        
相关标签:
2条回答
  • 2021-01-23 09:46

    The operator has to go inside the EL expression, not outside. You should see the #{...} as one big scope wherein various variables/conditions interact with each other.

    <x:someComponent rendered="#{bean.condition1 or bean.condition2}">
    

    See also:

    • Our EL wiki page
    • Conditionally displaying JSF components
    • How to conditionally render plain HTML elements like <div>s?
    0 讨论(0)
  • 2021-01-23 09:47

    The operator OR in an expression EL is ||.

    Try this:

    <ice:panelCollapsible  rendered ="#{mySessionBean.buttonVisibilities['myButton1'] || mySessionBean.buttonVisibilities['myButton2']}">
    

    See this tutorial http://docs.oracle.com/javaee/1.4/tutorial/doc/JSPIntro7.html

    Regards

    0 讨论(0)
提交回复
热议问题