3

I have a <h:panelGroup> tag with a rendered attribute. The function it calls to determine whether it renders or not returns true, I have logged and printed this to make sure.

The structure looks as follows:

<h:form>
    <div><!-- content --></div>
    <h:panelGroup>
        <h:panelGroup rendered="#{bean.function(parameter)} == true">
            <!-- content -->
        </h:panelGroup>
    <h:panelGroup>
</h:form>

The panelGroup with the rendered tag is never displayed, even though the function returns true. Any idea why this isn't working?

Skytiger
  • 1,745
  • 4
  • 26
  • 53

1 Answers1

5

The problem, that I have found(silly me) is that the rendered tag should be rendered="#{bean.function(parameter) == true}" as opposed to rendered="#{bean.function(parameter)} == true"

Skytiger
  • 1,745
  • 4
  • 26
  • 53
  • 4
    You can even omit the `== true` part altogether as the `function()` apparently returns a boolean already. – BalusC Sep 05 '13 at 12:14