JSTL expressions inside JSF Component
Hello *
I am experiencingc:if tag issues if embedded insideh:panel tags. Nesting a singlec:if tag works fine, but nesting two breaks the app.
Therefore I have to seprate out the JSTL tags into there own h:panel...bit messy.
Anyone else experence similar probs?
All the best.
J
# 2
As requested.
Init locked state is = true.
From memory unlock btn is displayed, but on submit no render difference.
<h:panelGrid >
<c:if test="${locked}">
<h:commandButton type="submit" value="Unlock" action="#{bean.unlock}" immediate="false" />
</c:if>
<c:if test="${not locked}">
<h:commandButton type="submit" value="Save" action="#{bean.save}" immediate="false" />
</c:if>
</h:panelGrid>
CURR_WORKAROUND - has resolved the problem, but not ideal because of additonal panel code which seems pointless
<h:panelGrid >
<c:if test="${locked}">
<h:commandButton type="submit" value="Unlock" action="#{bean.unlock}" immediate="false" />
</c:if>
</h:panelGrid>
<h:panelGrid >
<c:if test="${not locked}">
<h:commandButton type="submit" value="Save" action="#{bean.save}" immediate="false" />
</c:if>
</h:panelGrid>
regards
# 3
Just replace JSTL by JSF:
<h:commandButton type="submit" value="Unlock" action="#{bean.unlock}" immediate="false" rendered="#{bean.locked}" />
<h:commandButton type="submit" value="Save" action="#{bean.save}" immediate="false" rendered="#{!bean.locked}" />
Where the bean's method isLocked() returns a boolean value representing the locked state.