本文介绍了选择复选框上的行选择复选框数据表质数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码

<p:dataTable id="insList" var="insured"
                        value="#{policyHandler.insuredList}" paginator="true"
                        rows="#{label.insuredList_defaultNumberOfRows}"
                        paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                        rowsPerPageTemplate="#{label.insuredList_numberOfRows}"
                        style="width: 98%;" selection="#{policyHandler.inquiryInsureds}">                           <!--<p:column>
                            <f:facet name="header">
                                <h:outputLabel value="Select" />
                            </f:facet>
                            <h:selectBooleanCheckbox id="selection"
                                value="#{insured.status}">
                                <p:ajax event="click" update="insuredOrder, selection" />
                            </h:selectBooleanCheckbox>
                        </p:column>
                        -->
                        <p:column selectionMode="multiple" />
                        <p:column>
                            <f:facet name="header">
                                <h:outputLabel value="Sequence" />
                            </f:facet>
                            <p:cellEditor id="insuredOrder" disabled="#{!insured.status}">
                                <f:facet name="output">
                                    <h:outputText value="#{insured.sequence}" />
                                </f:facet>
                                <f:facet name="input">
                                    <p:inputText value="#{insured.sequence}" />
                                </f:facet>
                            </p:cellEditor>
                                <p:rowEditor />
                        </p:column>
                        <p:column headerText="Name"
                            sortBy="#{insured.generalPartyInfo.nameInfo.commlName.commercialName}"
                            filterMatchMode="contains" style="text-align:center;">
                            <h:outputText
                                value="#{insured.generalPartyInfo.nameInfo.commlName.commercialName}" />
                        </p:column>
                        <p:column sortBy="#{insured.generalPartyInfo.addr.city}"
                            style="text-align:center;">
                            <f:facet name="header">
                                <h:outputLabel value="Street Address" />
                            </f:facet>
                            <h:outputText value="#{insured.generalPartyInfo.addr.city}" />
                        </p:column>
                        <p:column sortBy="#{insured.generalPartyInfo.addr.city}"
                            style="text-align:center;" width="10%">
                            <f:facet name="header">
                                <h:outputLabel value="#{label.city}, #{label.state} " />
                                <h:outputLabel value=" #{label.postalcode}" />
                            </f:facet>
                            <h:outputText
                                value="#{insured.generalPartyInfo.addr.city}, #{insured.generalPartyInfo.addr.stateProv} #{insured.generalPartyInfo.addr.postalCode}" />
                        </p:column>
                        <p:column headerText="Policy Type">
                            <h:outputText value="#{insured.policyType}" />
                        </p:column>
                        <p:column headerText="Action" style="text-align:center;">
                            <p:commandLink>
                                <h:outputText value="Change" />
                            </p:commandLink>
                        </p:column>
                    </p:dataTable>

推荐答案

 <p:dataTable id="insList" var="insured"
                        value="#{policyHandler.insuredList}" paginator="true"
                        rows="#{label.insuredList_defaultNumberOfRows}"
                        paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                        rowsPerPageTemplate="#{label.insuredList_numberOfRows}"
                        style="width: 98%;">
                        <p:column>
                            <f:facet name="header">
                                <h:outputLabel value="Select" />
                            </f:facet>
                            <h:selectBooleanCheckbox id="selection"
                                value="#{insured.status}">
                                <f:ajax execute="@this"
                                listener="#{policyHandler.DoPathProcessing2}" render="insList"/>
                                <f:attribute name="insured" value="#{insured}" />
                            </h:selectBooleanCheckbox>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputLabel value="Sequence" />
                            </f:facet>
                            <p:cellEditor id="insuredOrder" disabled="#{!insured.status}">
                                <f:facet name="output">
                                    <h:outputText value="#{insured.sequence}" />
                                </f:facet>
                                <f:facet name="input">
                                    <p:inputText value="#{insured.sequence}" />
                                </f:facet>
                            </p:cellEditor>
                            <p:rowEditor />
                        </p:column>
                        <p:column headerText="Name"
                            sortBy="#{insured.generalPartyInfo.nameInfo.commlName.commercialName}"
                            filterMatchMode="contains" style="text-align:center;">
                            <h:outputText
                                value="#{insured.generalPartyInfo.nameInfo.commlName.commercialName}" />
                        </p:column>
                        <p:column sortBy="#{insured.generalPartyInfo.addr.city}"
                            style="text-align:center;">
                            <f:facet name="header">
                                <h:outputLabel value="Street Address" />
                            </f:facet>
                            <h:outputText value="#{insured.generalPartyInfo.addr.city}" />
                        </p:column>
                        <p:column sortBy="#{insured.generalPartyInfo.addr.city}"
                            style="text-align:center;" width="10%">
                            <f:facet name="header">
                                <h:outputLabel value="#{label.city}, #{label.state} " />
                                <h:outputLabel value=" #{label.postalcode}" />
                            </f:facet>
                            <h:outputText
                                value="#{insured.generalPartyInfo.addr.city}, #{insured.generalPartyInfo.addr.stateProv} #{insured.generalPartyInfo.addr.postalCode}" />
                        </p:column>
                        <p:column headerText="Policy Type">
                            <h:outputText value="#{insured.policyType}" />
                        </p:column>
                        <p:column headerText="Action" style="text-align:center;">
                            <p:commandLink>
                                <h:outputText value="Change" />
                            </p:commandLink>
                        </p:column>
                    </p:dataTable>

这篇关于选择复选框上的行选择复选框数据表质数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 18:38