But in following code h:selectManyListbox was not pre-populating the selected values.
code snippet was like this
<h:selectManyListbox styleClass="inputNameSel"
value="#{accountKeyBean.editSegment.actualValuesList}"
rendered="#{accountKeyBean.editSegment.methodType == 'Map'}">
<f:selectItems
value="#{accountKeyBean.validGLBusinessEntities}" var="misc"
itemLabel="#{misc.code}" itemValue="#{misc.code}" />
</h:selectManyListbox>
where
actualValuesList is List<MiscObject> and validGLBusinessEntities is also List<MiscObject>
I was able to populate the actualValuesList with List<MiscObject> which should be pre-selected.
I thought this will work because it was my understanding that 'value' element for h:selectManyListbox
should be of same type as that of 'value' element of f:selectItems.
I wondered, though I'm giving correct input to the actualValuesList, it is not showing the pre-selected items.
After lot of analysis, with my friend's help, could figure out that the datatype of actualValuesList should be List<String>, which worked :)
No comments:
Post a Comment