8 Replies Latest reply on Mar 2, 2009 7:12 AM by Nick Belaevski

    ModalPanel self rerender

    Matjaz Muhic Newbie

      I have 2 modal panels. One is main panel with chart and some stuff and one panel is loading panel.

      What I want is when you click an actionLink inside the main panel the panel rerenders it self but until it is not complete the loading panel is showed.

      Here is my code that does not work:

      <rich:modalPanel id="panel" width="750" height="350">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Modal Panel"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:outputText value="[X]" styleClass="hidelink" id="hidelink"/>
       <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
       </h:panelGroup>
       </f:facet>
       <h:panelGrid columns="2">
       <rich:dataTable width="75" id="avaliableDatesTable" value="#{chartBean.availableDates}" var="d">
       <rich:column>
       <a4j:commandLink reRender="panel" actionListener="#{chartBean.paramListener}" value="#{d.date}" timeout="30" onclick="Richfaces.hideModalPanel('panel');Richfaces.showModalPanel('loadingPanel')" oncomplete="Richfaces.hideModalPanel('loadingPanel');Richfaces.showModalPanel('panel')">
       <f:attribute name="chartDateFrom" value="#{d.dateFromInMSeconds}"/>
       <f:attribute name="chartDateTo" value="#{d.dateToInMSeconds}"/>
       </a4j:commandLink>
       </rich:column>
       </rich:dataTable>
      
       <chart:chart antialias="true" legend="false" type="timeseries" datasource="#{chartBean.dataSet}" height="300" id="chart1" title="#{chartBean.chartTitleDate}" width="600" xlabel="" ylabel=""/>
       </h:panelGrid>
       </rich:modalPanel>
      
       <rich:modalPanel id="loadingPanel" width="300" height="60">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Loading"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <rich:spacer height="5"/>
       <h:graphicImage value="resources/loading1.gif"/>
       <rich:spacer width="30"/>
       <h:outputText value="Loading chart data. This could take a while."/>
       </rich:modalPanel>
      


      The chartBean.paramListener does not invoke at all.