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

For example, your beans, pozzo and scenes may like it:

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

To retrieve the selected rows, simply reassign MyBean.customerList and check whether the The selected customer is the property of true .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -