4 Replies Latest reply on Nov 21, 2007 8:12 AM by ilya_shaikovsky

    Refresh another window

    frozone

      Hi Newsgroup,

      I got a question regarding the rerender component.
      In my page I got a link, which opens a small pop-up-window for a picture upload. Now when the upload is done, I want the calling page to rerender in order to show the uploaded picture.
      The upload works so far. But I did not manage to get the page rerendered.

      Do you have any hints for me?

      Thanks in advance!

      Frozone

        • 1. Re: Refresh another window

          use a4j:jsFunction in the popup window and call it from the base page using javascript when it needs

          • 2. Re: Refresh another window
            frozone

            Hi Sergey,

            thanks for your answer. Could you please explain a little bit more?

            Regards
            Cliff

            • 3. Re: Refresh another window

              I got the same problem here.
              I use a popup for the upload and I use a a4j:mediaOutput to show the uploaded image. The mediaOutput is only rendered if a file is uploaded. If I put a commandButton to reRender the image when clicked all works fine but I want it to be automatic, so I tried using a poll or push to rerender the mediaOutput during some interval without sucess. Is there a better way to do this or my poll is wrong?

              <a4j:poll reRender="insertQuestionOutputTextName,insertQuestionMediaOutputImage" interval="500">
              <a4j:mediaOutput id="insertQuestionMediaOutputImage" element="img" cacheable="false" session="false" createContent="#{crudSurvey.paint}" mimeType="image/jpeg" rendered="#{crudSurvey.uploaded}" />
              <h:outputText id="insertQuestionOutputTextName" value="#{crudSurvey.fileName}" />
              </a4j:poll>


              • 4. Re: Refresh another window
                ilya_shaikovsky

                you shouldn't wrap the mediaoutput to poll. just place the poll component in the form along.