How to set Boolean value to an 'Yes' or 'No' h:selectOneRadio

前端 未结 2 788
有刺的猬
有刺的猬 2021-02-15 15:57

I have the following code in JSF-2 Mojarra 2.0.8 running on Tomcat 7




        
2条回答
  •  眼角桃花
    2021-02-15 16:51

    You can also just check the enum value in the rendered attribute. Enums are evaluated as strings in EL, so you can do a simple string comparison. This way you can keep your original code.

    
    

    By the way, you perhaps really want to use execute="@this" instead of execute="@form" (or just remove it altogether, it defaults to @this already). The execute="@form" will process the entire form and thus also fire validation there where you perhaps don't want.

提交回复
热议问题