470,863 Members | 1,410 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

Open child window using JSF Components.

19
Hi,

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

Thanks,
Vinutha.
Feb 5 '07 #1
5 13850
acoder
16,027 Expert Mod 8TB
You can use window.open, e.g:
Expand|Select|Wrap|Line Numbers
  1. window.open('yourpage.html','test','width=100,height=100');
See this page for more info.
Feb 5 '07 #2
Vinutha
19
Hi acoder,

Thanks for your reply. Its working fine now.
This is my code,
Expand|Select|Wrap|Line Numbers
  1. <h:commandButton id="save" value="Save" onclick="fun()" />
  2.  
  3. function fun() {
  4. top.consoleRef=window.open('#{facesContext.externa lContext.requestContextPath}/main/patient/patient.jsf','myconsole',
  5. 'width=350,height=250'
  6. +',menubar=0'
  7. +',toolbar=0'
  8. +',status=0'
  9. +',scrollbars=1'
  10. +',resizable=0')
  11. top.consoleRef.document.close()
  12. }
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.
Feb 6 '07 #3
acoder
16,027 Expert Mod 8TB
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]
Feb 6 '07 #4
Vinutha
19
Hi,

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

Expand|Select|Wrap|Line Numbers
  1. function billingMain() {
  2. top.consoleRef=window.open('#{facesContext.externalContext.requestContextPath}/main/billing/billingMain.jsf','window1',
  3.                   'width=950,height=400'
  4.                    +',menubar=0'
  5.                    +',toolbar=0'
  6.                    +',status=0'
  7.                    +',scrollbars=1'
  8.                    +',resizable=0'
  9.                    +',location=0')
  10.                    top.consoleRef.document.close()
  11.                 }
  12.  
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,

Expand|Select|Wrap|Line Numbers
  1. function UB92Main() {
  2. top.consoleRef=window.open('#{facesContext.externalContext.requestContextPath}/main/billing/claimInformation.jsf','UB92',
  3.                   'width=450,height=250'
  4.                    +',menubar=0'
  5.                    +',toolbar=0'
  6.                    +',status=0'
  7.                    +',scrollbars=1'
  8.                    +',resizable=0'
  9.                    +',location=0')
  10.                    top.consoleRef.document.close()
  11.                 }
  12.  
here the second child window is not opening.
How to resolve this.

Thanks,
Vinutha.
Apr 13 '07 #5
acoder
16,027 Expert Mod 8TB
'top' refers to the top frame. Perhaps the child window doesn't have frames.
Feb 5 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ben Smeets | last post: by
3 posts views Thread by NeverLift | last post: by
3 posts views Thread by James Spibey | last post: by
3 posts views Thread by Maheshkumar.R | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.