I'm building a template using jsf tags that has an optional sidebar. To render the html for the sidebar, I need to check if it's content is actually defined. More specifically, I'm trying to do this: (element classes are from bootstrap)
<div class="row">
<div class="#{ check_if_has_sidebar ? 'col-md-9' : 'col-md-12' }">
page content
</div>
<div class="col-md-3" jsf:rendered="#{check_if_has_sidebar}">
<ui:insert name="sidebar-content" />
</div>
</div>
How can I check if the page using this template defines content for "sidebar-content" using ui:define?
The following solution (suggested in a similar thread) doesn't work because I need to check BEFORE the definition of the param 'noSideBar':
<div class="row">
<div class="#{ noSideBar ? 'col-md-9' : 'col-md-12' }">
page content
</div>
<div class="col-md-3" jsf:rendered="#{not noSideBar}">
<ui:insert name="sidebar-content">
<ui:param name="noSideBar" value="true" />
</ui:insert>
</div>
</div>