1 Reply Latest reply on Aug 22, 2013 7:50 PM by bleathem

    Picklist right side value is not populated while using inside a popuppanel

    jayas

      I am using rich:popuppanel component and having issues with populating values in picklist.

      My requirement is as below.

      1. Populate extended data table

      2. Select a row using check box - User ID in that row will be passed to backing bean

      3. Click assign button

      4. Popup panel should open with a picklist containing all users and assigned users

       

      The issue is, getAllUsers() call returns all users and left side of picklist is populated properly. But getAssignedUsers() is not called at all. So right side of pick list always empty.

       

      XHTML code is as below.

       

      <h:form id="audit">
      ...
      <h:commandButton id="Assign" value="Assign"      
        immediate="true" action="#{userBean.getSelectedUsers}" reRender="a4jPanel">
                      <f:ajax execute="@this" render="popupScript" />     
      </h:commandButton>
      <h:panelGroup id="popupScript">
                      <h:outputScript rendered="#{userBean.assignClicked}">
                          #{rich:component('assignUser')}.show();
                      </h:outputScript>
      </h:panelGroup>
      ...
      </h:form>

      <rich:popupPanel id="assignUser" autosized="true" resizeable="false">
                     <f:facet name="header">
                          <h:outputText value="#{msg.assignPopupHeader}">
                          </h:outputText>
                     </f:facet>
                     <h:form name="assign" id="assign">
                           <h:panelGrid cellspacing="5" id="popupGrid">
                                <a4j:outputPanel id="a4jPanel">
                                       <rich:pickList value="#{userBean.assignedUsers}"
                                               showButtonsLabel="false" sourceCaption="Available Users"
                                               align="center" targetCaption="Assigned Users" listWidth="165px"
                                               listHeight="100px" orderable="true" addText="&gt;" removeText="&lt;">
                                            <f:selectItems value="#{userBean.allUsers}" />
                                       </rich:pickList>
                                </a4j:outputPanel>
                                <center>
                                       <h:panelGrid columns="2" cellspacing="3" cellpadding="4">
                                               <a4j:commandButton id="assign" value="#{msg.userAssign}"
                                                           action="#{userBean.assignUser}"/>
                                               <h:commandButton value="#{msg.userCancel}"
                                                           onclick="#{rich:component('assignUser')}.hide();return false">
                                               </h:commandButton>
                                      </h:panelGrid>
                                </center>
                        </h:form>
      </rich:popupPanel>

       

      Please suggest how to call getAssignedUsers() when popup is opened and render picklist with updated values.

       

      Thanks!