1

我的数据表中有以下内容:

<a4j:commandLink rendered="#{item.Id eq Admin.filteredId}" id="app" action="#{DetailController.adminUpdate}"  value="Approve  " styleClass="auto-style5" actionListener="#{DetailController.adminPrepareEdit}">
                                <a4j:param assignTo="#{DetailController.selected.LevelsId}" value="2" />
                            </a4j:commandLink>

是否可以将其更改为复选框然后更改值?

问候。

4

1 回答 1

1

使用复选框和 ajax 重新呈现值。参见示例:

<rich:dataTable id="retailerTable" var="userRetailer">
...
<h:column>
    <f:facet name="header">
        <a4j:commandButton id="deleteRetailerButton"
            value="#{msg.delete}"
            action="#{userAction.deleteRetailersFromList}"
            type="button"
            render="retailerPanel"
            rendered="#{not empty user.userRetailers}"
            disabled="#{userAction.anyRetailerSelectedForDeleteFromList eq false}"
            onclick="if (!confirm('Are you sure you want to remove selected retailers?')) return false" />
    </f:facet>
    <h:selectBooleanCheckbox id="deleteRetailerCheckBox" value="#{userRetailer.delete}" >
        <a4j:ajax event="click" render="retailerTable" />
    </h:selectBooleanCheckbox>
</h:column>

于 2013-10-22T01:33:37.203 回答