webtier@glassfish.java.net

JSTL in Facelets not working as expected.

From: <webtier_at_javadesktop.org>
Date: Tue, 30 Mar 2010 13:31:10 PDT

I'm attempting do something like this.


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ice="http://www.icesoft.com/icefaces/component"
                 xmlns:c="http://java.sun.com/jstl/core">
    
    <c:set var="label" value="This will select some rows" />
    <c:if test="2 > 4">
        <c:set var="rendered" value="true" />
    </c:if>
    <c:if test="5 > 2">
        <c:set var="rendered" value="false" />
    </c:if>
    <ice:commandButton rendered="#{rendered}" actionListener="#{TestPage.button1_processAction}" id="button1" style="left: 48px; top: 524px; position: absolute" value="#{label}"/>
    <ice:commandButton actionListener="#{TestPage.button1_processAction}" id="button2" style="left: 48px; top: 564px; position: absolute" value="#{label}"/>
    
</ui:composition>

When this renders I get the following.

    <c:set value="This will select some rows" var="label"></c:set>
    <c:if test="2 &gt; 4">
        <c:set value="true" var="rendered"></c:set>
    </c:if>

    <c:if test="5 &gt; 2">
        <c:set value="false" var="rendered"></c:set>
    </c:if>
<input class="iceCmdBtn" id="form1:button2" name="form1:button2" onblur="setFocus(&#39;&#39;);" onclick="iceSubmit(form,this,event);return false;" onfocus="setFocus(this.id);" style="left: 48px; top: 564px; position: absolute" type="submit" value="" /><div id="form1hdnFldsDiv" style="display:none;"><input name="form1:j_idt5:j_idt6:dataScroll_3" type="hidden" /><input name="form1:j_idcl" type="hidden" />



This isn't exactly what I was looking for. I know the Facelets handles the JSTL on my page, why would it do so in this manner? I would like to be able to set the rendered property directly here without binding it to something in the backing bean.
[Message sent by forum member 'tracker09']

http://forums.java.net/jive/thread.jspa?messageID=394541