How to bind boolean property to rendered attribute?

I use the property booleanin a JSF managed bean and depending on its value I need to display the command link on the face. But the problem is that facelets shows this error:

The isPlayButtonEnabled property not found on my bean side

So, I checked the code by changing the property data type from booleanto String. Then the larvae did not find any error. But the command line component did not appear in the view. How is this caused and how can I solve it?

+5
source share
1 answer

The isPlayButtonEnabled property not found on my bean side

Remove the prefix isin the EL element. Now he is looking for a method isIsPlayButtonEnabled(). This should do:

<h:commandButton rendered="#{bean.playButtonEnabled}" />

with

public boolean isPlayButtonEnabled() {
    return playButtonEnabled;
}
+12

All Articles