first of all, you should not wrap your elements with h:gridPanel
, which leads to an html table
instead, you should enclose with h:panelGroup
, which leads to span
in the html code, you can also add layout="block"
to h:panelGroup
to make it display as a div
second you don't use jstl when hiding a div
instead do something like this
<div style="display:#{(myBean.hideSomeDiv)?'none':'block'}">My Div Content</div>
or
<h:panelGroup styleClass="#{(myBean.hideSomeDiv)?'hide':''">My Span Content</h:panelGroup>
where in the css file add this:
.hide { display: none; }
INMO , you always better hide in JSF with rendered="#{myBean.renderCondition}"
Take a look at BalusC here Conditionally Showing JSF Components
source share