richfaces - How to know which lines were selected from a DataTable -
I have "one page with rich data" for each table row, a checkbox was added so that the user was given an operation First, choose more than one line. How to retrieve the rows that were selected?
Just add a boolean, possibly For example, your beans, pozzo and scenes may like it: To retrieve the selected rows, simply reassign selected , which is POJO to
Represents a line for the rich: Datatable .
& lt; Rich: column & gt; & Lt; Rich: dataTable & gt; In
& lt; H: selectBooleanCheckbox & gt; Bind this bullion in
& lt; Rich: dataTable value = "# {myBean.customerList}" var = "customer" & gt; & Lt; Rich: Columns & gt; & Lt; H: Selection Bioline checkbox value = "# {customer.selected}" /> gt; & Lt; / Rich: Columns & gt; & Lt; Rich: Columns & gt; & Lt; H: output text value = "# {customer.name}" /> & Lt; / Rich: Columns & gt; & Lt; Rich: Columns & gt; & Lt; H: output text value = "# {customer.address}" /> & Lt; / Rich: Columns & gt; & Lt; / Rich: DataTable & gt; Public category MyBean {Private list & amp; Customer; Customers & gt; Customer list; // Guest class customer {Private Boolean selected; The name of the recipient and setter} personal string for the customer; Private string address; // recipients and setter for properties)
MyBean.customerList and check whether the
The selected
customer is the property of
true .
Comments
Post a Comment