Open child window using JSF Components.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vinutha
    New Member
    • Nov 2006
    • 19

    Open child window using JSF Components.

    Hi,

    How to open small window when i click Command Button or Command link in a webpage.

    Thanks,
    Vinutha.
    Last edited by Vinutha; Feb 5 '07, 05:17 AM. Reason: To change Title
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can use window.open, e.g:
    Code:
    window.open('yourpage.html','test','width=100,height=100');
    See this page for more info.

    Comment

    • Vinutha
      New Member
      • Nov 2006
      • 19

      #3
      Hi acoder,

      Thanks for your reply. Its working fine now.
      This is my code,
      Code:
      <h:commandButton id="save" value="Save" onclick="fun()" />
      
      function fun() {
      top.consoleRef=window.open('#{facesContext.externa lContext.requestContextPath}/main/patient/patient.jsf','myconsole',
      'width=350,height=250'
      +',menubar=0'
      +',toolbar=0'
      +',status=0'
      +',scrollbars=1'
      +',resizable=0')
      top.consoleRef.document.close()
      }
      When i click Save command button, the small browser window is opening.
      but its opening like browser, i want to open an window with my own custom title at the top of the window.
      How to solve this......

      Thanks,
      Vinutha.
      Last edited by acoder; Feb 6 '07, 09:00 AM. Reason: Code in tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by Vinutha
        When i click Save command button, the small browser window is opening.but its opening like browser, i want to open an window with my own custom title at the top of the window.
        How to solve this......
        You can set the title in your html page in the head section, e.g.
        [HTML]<html ...>
        <head>
        <title>My Custom Title</title>
        </head>
        <body>...[/HTML]

        Comment

        • Vinutha
          New Member
          • Nov 2006
          • 19

          #5
          How to open child window from another child window

          Hi,

          I have a java script function like this to open one child window form main window. Its working properly.

          [CODE=javascript]function billingMain() {
          top.consoleRef= window.open('#{ facesContext.ex ternalContext.r equestContextPa th}/main/billing/billingMain.jsf ','window1',
          'width=950,heig ht=400'
          +',menubar=0'
          +',toolbar=0'
          +',status=0'
          +',scrollbars=1 '
          +',resizable=0'
          +',location=0')
          top.consoleRef. document.close( )
          }
          [/CODE]
          But when my child window opened, i want to open another child window from previous child window.

          and here is the script follows for this,

          [CODE=javascript]function UB92Main() {
          top.consoleRef= window.open('#{ facesContext.ex ternalContext.r equestContextPa th}/main/billing/claimInformatio n.jsf','UB92',
          'width=450,heig ht=250'
          +',menubar=0'
          +',toolbar=0'
          +',status=0'
          +',scrollbars=1 '
          +',resizable=0'
          +',location=0')
          top.consoleRef. document.close( )
          }
          [/CODE]
          here the second child window is not opening.
          How to resolve this.

          Thanks,
          Vinutha.
          Last edited by acoder; Feb 5 '08, 09:56 AM.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            'top' refers to the top frame. Perhaps the child window doesn't have frames.

            Comment

            Working...