I have created checkboxes. When I selected multiple checkboxes then how can I get those multiple selected checkboxes value? my code is:
<h:selectManyCheckbox id="chkedition" value="#{adcreateBean.editionID}" layout="lineDirection" styleClass="nostyle">
<f:selectItems value="#{adcreateBean.editions}" var="item" itemLabel="#{item.editionName}" itemValue="#{item.editionID}"/>
</h:selectManyCheckbox>
I have taken value=”#{adcreateBean.editionID}” ,so it returns single value.
The
valueof the<h:selectManyXxx>component needs to point to an array orListof the very same type as theitemValue. Assuming that it’sLong, then it needs to be bound to aLong[]orList<Long>.E.g.
with
If you prefer a
List<Long>, then you should explicitly supply a converter for theLongtype, because generic types are erased during runtime and without a converter EL would setStringvalues in theListwhich would ultimately only result inClassCaseExceptions. Thus so:with