0 Replies Latest reply on Jul 16, 2012 8:07 AM by dhanaraja rajendiran

    rich:pickList target values are not loading while clicking on edit button

    dhanaraja rajendiran Newbie

      Hi Guys,


      I used rich:pickList in my application..it is working fine while i am adding some items for the first time and if i am submitting it is saveing successfully.


      In the same page I have an edit option also..


      while clicking on edit button i am getting the values from db and loading in target value (ie,userManagementBean.selectedUserRolesTO)..(checked by debugging my code values are properly setting in target)


      but still targets are not getting displayed for me..


      I guess there is something issue with my converter ...




      My xhtml page picklist:-

      <rich:pickList value="#{userManagementBean.selectedUserRolesTO}" label="Roles" required="true" requiredMessage="Roles Required">
      <f:selectItems value="#{userManagementBean.rolesLists}" var="rolesObj"  itemLabel="#{rolesObj.roleCode}" />
      <f:converter converterId="RolesConverter" />
      <rich:pickList />




      public class RolesConverter implements Converter {




          public Object getAsObject(FacesContext facesContext, UIComponent component, String s)



              HashMap<String, GmUserRolesTO> map =

                      (HashMap<String, GmUserRolesTO>) SessionHelper.getFromSession("convertToRoleObj");

              return (GmUserRolesTO) map.get(s);




          public String getAsString(FacesContext facesContext, UIComponent component, Object o)


              if (o == null)

                  return null;

              return ((GmUserRolesTO) o).getRoleCode();






      if you have any idea let me know...


      Note:I am using spring framework