The selectManyCheckbox component creates a component which allows the user to select many values from a series of checkboxes. Below is the code to retrieve selected items from selectManyCheckbox using ValueChangeListener method.
Note:- valueChangeEvent.getNewValue() will return Object value like [Ljava.lang.Object;@fcfd12, need to loop the object arrayList to get the values.
In Below image, how the selectManyCheckbox will be displayed at run time and user selected check box values will be displayed in Jdeveloper console.
Note:- valueChangeEvent.getNewValue() will return Object value like [Ljava.lang.Object;@fcfd12, need to loop the object arrayList to get the values.
public void myValueChangeListener(ValueChangeEvent valueChangeEvent) {
Object[] objArr = (Object[])valueChangeEvent.getNewValue();
for (int x = 0; x < objArr.length; x++) {
Object obj = objArr[x];
System.out.println(obj.toString());
}
}
In Below image, how the selectManyCheckbox will be displayed at run time and user selected check box values will be displayed in Jdeveloper console.
Hi,
ReplyDeletei am using same code but its giving me index number not a value.
Hi,
ReplyDeleteme too getting index number of the rows but not names...