3 Replies Latest reply on Mar 15, 2011 6:57 PM by kragoth

    Open an google inside rich modalPanel

    lucasmonsterrocha

      Hello people, i want click in an link an open a modal with any url that i want, for example http://www.google.com how i do this, i've tried




      <a href="#" onclick="Richfaces.showModalPanel('googleModal', {top:'100px', left:'100px', height:'400px'})">
                                              google
                                      </a>



      this is the modal


      <rich:modalPanel id="correioModal" > 
                                      <f:facet name="controls">
                                      <a href="javascript:Richfaces.hideModalPanel('correioModal')">X</a>
                                  </f:facet>
                                      
                              </rich:modalPanel>





      but in the place of a href i've put http://www.google.com but open the parent window , is there any attribute of the showModalPanel function that i can say the url that i want to open inside, i've try before top put location.href:http://www.google.com.br but not iven the modalpane appear


      thanx


        • 1. Re: Open an google inside rich modalPanel
          kragoth

          This question should be on the richfaces forum not Seam.


          But, since your here. Just use an iFrame inside the modalPanel


          <rich:modalPanel id="testPanel">
              <iframe src="http://www.google.com"></iframe>
          </rich:modalPanel>
          



          To take it further you could just use a param/EL expression in the src attribute.


          <rich:modalPanel id="testPanel">
              <iframe src="#{myParam}"></iframe>
          </rich:modalPanel>
          



          A modal panel is not what you are trying to make it be. Try thinking of the modal panel as a DIV. You can't set a div to display a url. You need to add stuff to it. Same goes for a modal panel.

          • 2. Re: Open an google inside rich modalPanel
            lucasmonsterrocha

            ok i will post in the correct forum next time, but th eiframe inside didn't work it start tring to open the google but the model is closed and then the 'parent' window opens the google

            • 3. Re: Open an google inside rich modalPanel
              kragoth

              lucas rocha wrote on Mar 14, 2011 14:36:


              ok i will post in the correct forum next time, but th eiframe inside didn't work it start tring to open the google but the model is closed and then the 'parent' window opens the google


              I'm sorry but, I don't quite understand what you are saying here. Can you try explain it a little clearer?