3 Replies Latest reply on Mar 24, 2009 8:38 AM by Matjaz Muhic

    ModalPanel oncomplete (Looks like it never invokes)

    Matjaz Muhic Newbie

      I have a modal panel with chart and some dates that you can pick. Whenever you pick a date the panel reRenders it self.

      But on main page I have a image wrapper in a4j:commandLink and the link should reRender that modal panel and show it with oncomplete="Richfaces.showModalPanel('trafficPanel')".

      The self reRender works fine, and the a4j:commandLinks are the same as the link on main page. But on main page if I want oncomplete to show modal panel, it never shows up. Almost like the request never completes.

      Any ideas?


      ModalPanel:

      <rich:modalPanel id="trafficPanel" width="1150" height="650">
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Traffic"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:outputText value="[X]" styleClass="hidelink" id="hidelinkTraffic"/>
       <rich:componentControl for="trafficPanel" attachTo="hidelinkTraffic" operation="hide" event="onclick"/>
       </h:panelGroup>
       </f:facet>
       <h:form id="trafficPanelForm">
       <h:panelGrid columns="2" columnClasses="topAlign">
       <h:panelGrid columns="1" columnClasses="topAlign">
       <rich:spacer height="15"/>
       <h:outputText value="History" />
       <rich:dataList value="#{customChartBean.availableDates}" var="d">
       <a4j:commandLink reRender="trafficPanel" actionListener="#{customChartBean.paramListener}" onclick="Richfaces.showModalPanel('loadingPanel');Richfaces.hideModalPanel('trafficPanel')" oncomplete="Richfaces.hideModalPanel('loadingPanel');Richfaces.showModalPanel('trafficPanel')">
       <h:outputText value="#{d.date}"/>
       <f:attribute name="chartDateFrom" value="#{d.dateFromInMilis}"/>
       <f:attribute name="chartDateTo" value="#{d.dateToInMilis}"/>
       <f:attribute name="trafficChart" value="true"/>
       </a4j:commandLink>
       <br/>
       </rich:dataList>
       </h:panelGrid>
       <a4j:mediaOutput id="chart2" element="img" cacheable="false" createContent="#{customChartBean.makeRealTimeTrafficChart}" mimeType="image/png" >
       <f:param name="time" value="#{customChartBean.timestamp}"/>
       </a4j:mediaOutput>
       </h:panelGrid>
       </h:form>
       </rich:modalPanel>
      


      commandLink on main page:
      Traffic:
       <a4j:commandLink reRender="trafficPanel" onclick="Richfaces.showModalPanel('trafficPanel')">
       <h:graphicImage styleClass="noBorder" width="28" height="23" id="imgGraph" value="resources/icon_chart.gif"/>
       </a4j:commandLink>
      


      Oh, btw. The main page commandLink is in rich:toolBar (if that helps anyhow).


      Thanks!