I have started working with richfaces:pickList and really struggling how to use it.
how to get pickList.getValue(); this is of type java.util.Arrays$ArrayList. Kindly help.
You can ask me why are you trying to access through listener its already available by model update. The case is I want to sort the target values as they are added.
<rich:pickList id="brandPickList"
value="#{advDocFilterMgr.brandTargLst}"
moveControlsVerticalAlign="middle"
valueChangeListener="#{advDocFilterMgr.handlePickListChange}">
<f:selectItems value="#{advDocFilterMgr.brandSrcSet}"/>
<a4j:support event="onlistchanged" actioneventsQueue="mainQueue" reRender="brandPickList"/>
</rich:pickList>
public void handlePickListChange(ValueChangeEvent changeEvent){
HtmlPickList pickList = (HtmlPickList)changeEvent.getSource();
String pickListId = pickList.getId();
if ("brandPickList".equals(pickListId))
{
System.out.println(pickList.getValue() instanceof ArrayList);
System.out.println(pickList.getValue() instanceof Array);
how to get pickList.getValue(); this is of type java.util.Arrays$ArrayList
}
}
I had a work around for this. I gave up using valueChangeListener.
inteadI introduced <a4j:support action=".." /> through which I couldaccess updated taget list and sort it. reRender does the refresh part.
Message was edited by: Srinivasan Thoyyeti