jsf - How to add to the object of SelectManyCheckbox selected values? -
I have an object of SelectManyCheckbox for this object, I set the value available in the next value:
< Pre> SelectManyCheckbox checkbox = New SelectManyCheckbox (); & Lt; Double & gt; Selected = new ArrayList & lt; Double & gt; (); // This will be used to set selected values list & lt; SelectItem & gt; Items = new Arsuachi & amp; Lt; SelectItem & gt; (); // It will be used as the values available for some object (av: listOfObjects) {SelectItem items = New SelectItem (av.getNumericValue (), av.getValue ()); Items.add (item); If (av.getDefault ()) {selected.add (av.getNumericValue ()); }} UISelectItems uiItems = new UISelectItems (); UiItems.setValue (item); . Checkbox.getChildren () (uiItems) add; Checkbox.Set selected value (new double [selected size ()]);
But this setting of the selected values does not work. Maybe someone knows that is the source of the problem?
Your double [] is empty, try changing the list of arrays like this: / P>
checkbox .Set value (selected. Star (new double [selected size ()]));
Comments
Post a Comment