user1794974
user1794974

Reputation: 151

JSF checkbox in datatable change

I have the following in my datatable:

<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>

Will it be possible to change it to a checkbox and then change the values?

regards.

Upvotes: 1

Views: 490

Answers (1)

Vasil Lukach
Vasil Lukach

Reputation: 3728

Use checkbox and ajax for rerendering value. See example:

<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>

Upvotes: 1

Related Questions