multipleselection

How do I insert multiple checkbox values into a table?

…衆ロ難τιáo~ 提交于 2019-11-26 10:37:48
问题 I cant seem to find or figure out a working solution to insert multiple checkbox values from a form into a table. The closes I have come is inserting the value of merely one checkbox value into a table. Kindly point out how I can insert multiple checkbox values and not merely one. Find below what I have so far: My form: <html> <body> <form method=\"post\" action=\"chk123.php\"> Flights on: <br/> <input type=\"checkbox\" name=\"Days\" value=\"Daily\">Daily<br> <input type=\"checkbox\" name=\

How to use <h:selectBooleanCheckbox> in <h:dataTable> or <ui:repeat> to select multiple items?

亡梦爱人 提交于 2019-11-26 08:23:45
I have a Facelets page with a <h:dataTable> . In each row there is a <h:selectBooleanCheckbox> . If the checkbox is selected the object behind the corresponding row should be set in the bean. How do I do this? How to get the selected rows or their data in a backing bean? Or would it be better to do it with <h:selectManyCheckbox> ? Your best bet is to bind the h:selectBooleanCheckbox value with a Map<RowId, Boolean> property where RowId represents the type of the row identifier. Let's take an example that you've a Item object whose identifier property id is a Long : <h:dataTable value="#{bean