I have the following code in JSF-2 Mojarra 2.0.8 running on Tomcat 7
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.