java - Right side of my RichFaces pickList not populating with default values -
i wondering if please help. experiencing challenge. when in backing bean works fine:
private string [] testright; private string [] testleft; (with getters , setters) public void initalizeleftrightside2() { this.testleft = new string[5]; this.testright = new string[2]; testleft[0] = "module1"; testleft[1] = "module2"; testleft[2] = "module3"; testleft[3] = "module4"; testleft[4] = "module5"; testright[0] = "module2"; testright[1] = "module4"; }
but when module objects right side not populated:
private list<modules> allmodules; private list<modules> forselectedrole; public void initalizeleftrightside3(long selectedroleid) { this.allmodules = modrole.getallmodules(); roles therole = modrole.getmodulelistbyroleid(selectedroleid); this.forselectedrole = therole.getmoduleslst(); }
my jsf initialize picklist converter implemented:
<rich:picklist value="#{addmoduletorole.forselectedrole}" sourcecaption="available modules" targetcaption="selected modules" listwidth="200px" listheight="200px" > <f:selectitems value="#{addmoduletorole.allmodules}" var="moules" itemvalue="#{moules}" itemlabel="#{moules.name}" /> <f:converter converterid="modulesconverter" /> </rich:picklist>
just add forselectedrole subset of allmodules.
thanks in advance assistance.
further vasil's comment, calling initalizeleftrightside3(rselected) method second stage in process of updating modules attached particular role. 1st stage user select role updated submits following code.
public void processaddmodule2role() {
//first role selected long rselected = long.parselong(getselectedrole()); initalizeleftrightside3(rselected); //redirect addmoduletorole2.xhtml contains picklist sh.redirect2("/pages/admin/rolemgmt/addmoduletorole2.xhtml"); }
thanks again.
Comments
Post a Comment