0 Replies Latest reply on Oct 20, 2011 8:47 AM by quajo

    Execute createContent in a4j:mediaOutput only showing the popupPanel container

    quajo

      Hi, I have a popupPanel in a page with a a4j:mediaOutput component inside that is going to contain different images. The specific displayed image depends on different conditions during execution. This popupPanel is shown clicking in a4j:commandButton. All works fine and the image is changing when I change the conditions, but I would like that when the page loads for first time the method associated to the createContent tag of mediaOutput wasn´t executed. I only want that it was executed when I click on the commandButton. How can achieved this? Using the rendered tag with a boolean condition?

       

      This is my code:

       

      <rich:popupPanel id="panel_photo_show" modal="true" autosized="true">

                          <f:facet name="header">

                                              <h:panelGroup>

                                                        <h:outputText value="Fotos"></h:outputText>

                                              </h:panelGroup>

                                    </f:facet>

                                    <h:form id="photo_show_form">

                                    <a4j:outputPanel ajaxRendered="true">

                        <a4j:mediaOutput element="img" cacheable="false" session="true" id="img"

                  createContent="#{imageHandler.process}" value="#{imageData}" mimeType="image/jpg" alt="img" />

                  </a4j:outputPanel>               

              <center>   

              <a4j:commandButton value="Aceptar"

                                                                  onclick="#{rich:component('panel_photo_show')}.hide();"/></center>

                          </h:form>                                           

         </rich:popupPanel>

       

       

      Thanks