java - JSF: display h:selectManyCheckBox vertically in h:dataTable -
I have a face that displays a list of products in tablet format. In the last column of each row, a checkbox is used to mark the product to be used. So far, I've put a select Boulion checkbox in each line and the property has the property of "mark to remove", but I think it's ugly because there is some presentation material in my model bean.
For anyway ah: select several checkboxes, which have its prefix: SelectItem delivers on each row of datatelles?
Thanks
This is a great suggestion.
As an alternative, you can also force h: selectBooleanCheckbox
component to the map & lt; Boolean & gt;
Property where long
represents the entity ID (or whatever identifier you can use to identify the line) and boolean
are checked Represents the state.
Example
Public category bean {Private list> Unit & gt; Institutions; Private map & lt; Long, Boolean & gt; Check = new Hashmop & lt; Long, Boolean & gt; (); Public void submit () (for (unit unit: entities) {if (checked.get (entity.getId ())} // // has checked the unit. Talk it out here}}} // ...}
automatically all The id of the place will be filled in and the checkbox value as the map keys is set as the map value as the unit ID key.& lt; h: with data value = "# {bean.entities}" var = "unit" & gt; & lt; H: pillar & gt; & lt; h: Selection Bioline checkbox value = "# {bean check [entity.id]}" /> ...
map & lieutenant; long, boolean & Gt;
Also see:
- < Li>
Comments
Post a Comment