I use <h:dataTable> to list data from database. We have many records in page, now I would like to select multiple records with a checkbox in each row. How can I achieve this?
How to select multiple rows of <h:dataTable> with <h:selectBooleanCheckbox>
6.2k Views Asked by xuanhung2401 At
1
There are 1 best solutions below
Related Questions in JSF
- Strange java.lang.ArrayIndexOutOfBoundsException rendering error in jsf application under high load
- h:outputStylesheet inside ui:repeat
- IntelliJ warns "Cannot resolve variable" on EL variables declared in parent page of include
- How to instantiate a backing bean on page load
- How to disable default keyCode event in Primefaces?
- How to define a style for ul which appears automatically
- How to add '%' symbol in textbox using jsf and jsp?
- Primefaces onkeyPress triggerevent
- h:commandButton action method is not invoked
- f:ajax resetValues="true" does not seem to work
- Primefaces datatable duplicate "No records found" while doing column freeze for empty records
- How to provide a file download from a JSF backing bean using af:commandMenuItem?
- Remove message from h:outputText ofter time
- How to change the position of confirmation box in jsf primefaces?
- commandLink not working when images are in same line
Related Questions in DATATABLE
- DataTable does not release memory
- SQL - How to put beside two records of the same table in the same row
- Export DataTable to CSV File with "|" Delimiter
- Primefaces datatable duplicate "No records found" while doing column freeze for empty records
- Clean a DataTable in a loop moving used items to two other DataTables
- Checkboxes will only work on current pagination page in jQuery datatables
- How to remove datatable from dataset?
- How to pre-select rows in Shiny DT datatables
- @postConstruct method with parameter
- Pivoting values from datatable
- Adding image to GridView created in CodeBehind
- DataTable.Update Fails and Throws DBConcurrencyException
- Collection was modified; enumeration operation might not execute on Except operation
- Divide Rows of DataTable
- update cell from primefaces datatable after action invoked
Related Questions in MULTIPLESELECTION
- Multiple TextView selection in GridView
- Cannot cast CheckableLayout and highlight selected items
- Deselection of a row taking time in NSTableView
- How to save the state of the check position items in a multiple choice list view
- Obtaining values from select multiple
- Swift - selectRowAtIndexPath not working with indexPathForSelectedRows
- Binding textbox to multiple selected items in listbox
- How to apply filter based on multiple selected rows in UITableView using swift 3
- How to create comma seperated value in javascript on selection of values from multiple selection select box?
- Select / Unselect user control
- Retrieving selected values in Materialize CSS multiple select using JavaScript
- IPhone: different row selected
- Custom UITableViewCell, UITableView and allowsMultipleSelectionDuringEditing
- Jquery: multiple selectboxes, same name....select one item and open in new tab
- Buy Now button with a selection for the number of tickets requested
Related Questions in SELECTBOOLEANCHECKBOX
- Update on h:selectBooleanCheckbox loose css
- Value of <h:selectBooleanCheckbox> inside <p:dataTable> remains false on submit
- Select all checkbox in primefaces
- p:selectbooleancheckbox is moving when slected in a p:dataTable
- selectBooleanCheckbox action not working
- How to get checked state of <p:selectBooleanCheckbox> in jQuery
- PrimeFaces selectBooleanCheckbox cheked on label click
- How to use <h:selectBooleanCheckbox> in <h:dataTable> or <ui:repeat> to select multiple items?
- How to send the currently iterated item to h:selectBooleanCheckbox with f:ajax event=change
- How to get the ID attribute of h:selectBooleanCheckbox in backing bean
- Ajax render not working on SelectBooleanCheckbox
- Set bean value on click of selectbooleancheckbox
- selectBooleanCheckBox in ui:repeat doesn't call listener
- SelectBooleanCheckbox in editable DataTable doesn't change
- Why h:selectBooleanCheckbox not is updated?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I assume that your entity is that well-designed that it has an unique technical identifier, for example the auto increment sequence from the DB.
If not, you'll need to add it.
Then, add a
Map<Long, Boolean>property to the bean which is tied to the table.(preinitialization can also happen in (post)constructor, take your pick, at least JSF won't do it for you; oh, give it a getter as well, a setter is not necessary)
Then, add a column with a checkbox which maps to the boolean value by entity ID as key.
Now, in the action method associated with the delete button, you can collect and delete the checked items as follows: