7 Replies Latest reply on Feb 17, 2009 8:47 AM by Matjaz Muhic

    mediaOutput in modal panel

    Matjaz Muhic Newbie

      I have a problem generating mediaOutput in a modal panel. The image is generated before the modal panel is even opened. I want the media to be generated when the modal panel is showed. And I want to pass in the parameter.


      Here's the code for calling the modal panel. I want to pass in the parameter here.

      <h:graphicImage width="28" height="23" id="imgGraph" value="resources/icon_chart.gif"/>
       <rich:componentControl for="panel" attachTo="imgGraph" operation="show" event="onclick" params="#{p.agentID}"/>
      


      And here's the modal panel.
      <rich:modalPanel id="panel" width="650" height="250">
       <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]" id="hidelink"></h:outputText>
       <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
       </h:panelGroup>
       </f:facet>
       <a4j:mediaOutput id="mediaChart" standby="Loading chart..." element="img" cacheable="false" session="true" createContent="#{chartBean.generateChart}" mimeType="image/jpeg" />
       </rich:modalPanel>
      


      So the idea is, for every row in datatable I show an image and when you click on it the ID of that row (item) is passed to the chart generator so I generate chart after modal panel is opened.


      Thank you!