• Post Reply Bookmark Topic Watch Topic
  • New Topic

primefaces h:selectManyListbox issue

 
Anitha Pillai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<p:panel styleClass="innerPanel_new" id="bstore">
<h:panelGrid columns="2" columnClasses="labelColumn, valueColumn">
<h:outputLabel value="StoreBrands to be Blocked: " styleClass="ioText" />
<h:selectManyListbox style="width:150px;height:80px"
value="#{natbudgetMgmtMB.blockedRetailers}"
converter="universal">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{natbudgetMgmtMB.retailerList}"
var="sret" itemValue="#{sret.id}" itemLabel="#{sret.name}" />
</h:selectManyListbox>
</h:panelGrid>

</p:panel>


Backbean:

List<BlockedStoreRetailer> blockedRet = natBudgetService.readBlockedRetailers(nbudget.getId(),"N");
if(blockedRet != null && !blockedRet.isEmpty()){
for(BlockedStoreRetailer bret: blockedRet){
listRet.add(bret.getStoreRetailer());
}
setBlockedRetailers(listRet);
.......

public List<StoreRetailer> getBlockedRetailers() {
return blockedRetailers;
}

public void setBlockedRetailers(List<StoreRetailer> blockedRetailers) {
this.blockedRetailers = blockedRetailers;
}


-----------------

problem: When I select multiple values, it get saved correctly.
But when I come back and reload the display screen, even though "blockedRetailers" has value in it, the
values does not appear selected in the screen... Any ideas why?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!