渲染的属性不起作用

时间:2013-08-02 16:43:31

标签: jsf jsf-2

我有一个动态表单元素,您可以添加和删除文本框。该元素有一个标题。当没有文本框时,我不希望呈现标题。我正在尝试使用呈现的属性显示和隐藏此标题,但它无法正常工作。我的代码如下:

<!-- Dynamic form element with add and remove capabilities (see above) -->
    <h:outputLabel value="Base Maps: " for="baseMaps" />
    <h:panelGrid id="itemPanel">
        <h:dataTable binding="#{itemTable}" value="#{account.item}" id="item">
            <h:column>
                <f:facet name="header" rendered="#{account.isNotEmpty(account.item)}">Item Name</f:facet>
                <h:inputText value="#{account.item[itemTable.rowIndex]}" />
            </h:column>
            <h:column>
                <h:commandLink value="Delete" action="#{account.remove(itemTable.rowIndex,account.item)}"
                               styleClass="form-delete">
                    <f:ajax execute="@form" render="@form" />
                </h:commandLink>
            </h:column>
        </h:dataTable>
        <h:commandButton value="add" action="#{account.add(account.item)}">
            <f:ajax execute="@form" render="@form" />
        </h:commandButton>
    </h:panelGrid>

0 个答案:

没有答案