I have a multiselect listbox and depending on how many elements user will choose I have to show same number of checkboxes. I’m using jsf and primefaces /spring webflow. How I can do that? Any examples?
And I have to make one checkbox which allow to check all generated checkboxes using one click.
I have a multiselect listbox and depending on how many elements user will choose
Share
Thus, a
<h:selectManyListbox>with a fixed<f:selectItems>value.With something like:
Thus, just prepopulate the
<f:selectItems>of a<h:selectManyCheckbox>based on the value of the<h:selectManyListbox>.with something like
I believe the above trivial examples are sufficient. For PrimeFaces, just replace
<h:xxx>with<p:xxx>. I have however no idea how Spring Webflow plays a role in this as I have never used it.That’s left as an exercise for you. Hint: make sure that
availableCheckboxItemscontains the desired values depending on the current value of the<h:selectBooleanCheckbox>which should represent the “toggle selected items”.