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 answers
Related Questions in JSF
- Calling custom AuthenticationHandler from Faces bean throws IllegalStateException: Cannot change buffer size after data has been written
- Force security constraint managed 403 error when hitting restricted page with h:commandLink
- primefaces component id not found in update
- LazyDataModel, custom filter with search button
- How to use SelectManyCheckbox with ArrayList as HashMap value
- how to surpress logging of jsf "There are some unhandled FacesMessages"
- SelectManyCheckbox returns array of Object[] instead of ArrayList
- My dialog component on PrimeFaces can't render a list on first click
- How to retrieve posted data via FacesContext
- I'm using JSF and after a timer expires, I want to display a warning
- Why print result is blank?
- PrimeFaces centering searchbar on menubar
- JSF: p:fileUpload requiredmessage is apearing on click of another button
- How can I make sure that JSF works?
- Is there an already-made template project using Spring, JSF, PrimeFaces, SOAP and MySQL?
Related Questions in DATATABLE
- Show DataGrid rows in Stimulsoft report Same order as DataGrid
- Laravel Livewire data table sorting livewire update payload
- Having a problem in datatables and fullcalendar scripts
- Is there a way to set a cells value based on the value this cell held at a certain time, even when the cell value changes over time?
- how to create a datatable with multiple data listing and sorting in same column?
- How can I change pages when searching by id for an element in a table? Vue js
- My DataTable becomes stuck when navigating between the table pages
- "Uncaught SyntaxError: Unexpected end of JSON input" when use DataTable in ASP.NET Boilerplate
- Merge three Datatables deleting duplicates rows after copying their column data to the remaining row, finally sorting twice
- is there a way in vuetify to adjust padding in data table?
- how to import dat files into datagridview with VB.NET
- Error https://datatables.net/tn/7 Datatable serverside processing
- nextjs primereact datatable : fails to render if mapped
- Why is it when I try to select all the rows, they only select the rows from the current active page while I need it to select all rows from all pages?
- Balance column in a HTML table using PHP
Related Questions in MULTIPLESELECTION
- Multiple Selection Navigation View List
- Counting occurrences of Value in Multiple Selection with GoogleSheets
- Multi-select Filter Checkbox with dynamic array values
- In C# Forms How to Trap or Isolate when a Listview box is done updating with multiple selections?
- Selection of multiple html elements with the help of document.getSelection()
- How to select HTML elements with document.getSelection() in JavaScript,
- Change Power Apps Combo Box single selected value to multiple selection
- How do I set a limit to max number of selections in multi select menu in Material UI react
- .Net MAUI: How to select single and multiple items using MVVM and CollectionView
- VBA search for all matches in column and display all matches of column
- SwiftUI Selection Sets and Core Data - setting up NSPredicate with the object identifier
- Infragistics UltraGrid selecting first row in addition to programmatic selection
- Python graphic interface for data visualisation that "leaks data"
- Issue in tableview cell selection and deselection using button in swift
- Calculate sum connected to selection from multiple dropdown in Google Sheets
Related Questions in SELECTBOOLEANCHECKBOX
- p:selectBooleanCheckbox *look only* shifted after adding a row to a p:dataTable
- p:selectbooleancheckbox is moving when slected in a p:dataTable
- get boolean value from selected row of datatable
- selectBooleanCheckBox in ui:repeat doesn't call listener
- Select all checkbox in primefaces
- How to get the ID attribute of h:selectBooleanCheckbox in backing bean
- PrimeFaces selectBooleanCheckbox cheked on label click
- How can I set border to panelGroup through selectedBooleanCheckBox
- selectBooleanCheckbox action not working
- when i click on the p:selectBooleanCheckbox, it works but for the second click it doesn't work,why?
- h:selectBooleanCheckbox ajaxsupport event is not working if it exists in two different h:forms in jsf
- JSF boolean property not getting updated selectBooleanCheckbox
- Why h:selectBooleanCheckbox not is updated?
- Update on h:selectBooleanCheckbox loose css
- Change event is behaving different than expected on h:selectBooleanCheckbox
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?
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)
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: