1 Reply Latest reply on Jan 11, 2010 5:58 PM by nbelaevski

    listShuttle/picklist and modalPanel issue.

      Hi all, I'm having a problem with listShuttle / pickList when the components are rendered in a modalPanel.

      I'm using 3.3.2 version.

       

      The problem is that when the modalPanel is closed, the action of the button that triggers the "hidemodalpanel" script is being called before the targetValue is being updated with the selected input.

       

      Probably this sentece only make sense to me... Here's some code

       

      ==========================

                  <rich:modalPanel id="myPanel" width="675" height="300">
                      <f:facet name="header">
                          <h:panelGroup>
                              <h:outputText value="Panel Title"></h:outputText>
                          </h:panelGroup>
                      </f:facet>  

       

                          <rich:listShuttle id="entityList" sourceValue="#{bean.availableEntities}"
                              targetValue="#{bean.selectedEntities}" var="entity"
                              listsHeight="200" sourceListWidth="300" targetListWidth="300"
                              sourceCaptionLabel="Available"
                              targetCaptionLabel="Selected"
                              converter="er_list_converter"
                              orderControlsVisible="false"
                              showButtonLabels="false"
                              fastOrderControlsVisible="false">
                              <rich:column>
                                  <h:outputText value="#{entity.name}"></h:outputText>
                              </rich:column>
                          </rich:listShuttle>
             
                      <a4j:commandButton id="closeButton" value="Ok" type="submit"
                          action="#{bean.refreshEntities}">
                         
                           <rich:componentControl for="myPanel" attachTo="closeButton" operation="hide" event="onclick"/>
                      </a4j:commandButton>

                      <a4j:commandButton value="Back"
                           type="reset" immediate="true" oncomplete="Richfaces.hideModalPanel('myPanel')"/>
                 
                  </rich:modalPanel>

       

      ==========================

       

      The method bean.refreshEntities is being invoked as expected, but if I do a sysout of bean.selectedEntities, I do not see the updated value but the old one. After the modalPanel is closed and the action invoked has finished the collection bean.selectedEntities is updated.

       

      I tried with pickList, closing the modalPanel with rich:componentControl, using f:setPropertyListener, etc...

       

      what am I doing wrong?

      Thanks!