A simple value picker like;
<xe:valuePicker id="valuePicker2" for="inputText1">
<xe:this.dataProvider>
<xe:simpleValuePicker valueList="${javascript:return ['a', 'b', 'c']}"></xe:simpleValuePicker>
</xe:this.dataProvider>
</xe:valuePicker>
generates the following exception:
java.lang.ClassCastException: java.util.Vector incompatible with java.lang.String
at com.ibm.xsp.extlib.component.picker.data.SimpleValuePickerData.restoreState(SimpleValuePickerData.java:122)
at com.ibm.xsp.util.SerializableState.restore(SerializableState.java:79)
at com.ibm.xsp.util.FacesUtil.objectFromSerializable(FacesUtil.java:1435)
at com.ibm.xsp.extlib.component.picker.UIValuePicker.restoreState(UIValuePicker.java:59)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1381)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1395)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1395)
.....
It works if you use #{...} but not with ${...}. On the source code, we can see the problem;
@Override
public void restoreState(FacesContext _context, Object _state) {
Object _values[] = (Object[]) _state;
super.restoreState(_context, _values[0]);
<strong> valueList = (String)_values[1];</strong></div>
valueListSeparator = (String)_values[2];
labelSeparator = (String)_values[3];
caseInsensitive = (Boolean)_values[4];
}
There is a wrong casting.