By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,658 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,658 IT Pros & Developers. It's quick & easy.

Open child window using JSF Components.

P: 19
Hi,

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

Thanks,
Vinutha.
Feb 5 '07 #1
Share this Question
Share on Google+
5 Replies

acoder
Expert Mod 15k+
P: 16,027
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

P: 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
Expert Mod 15k+
P: 16,027
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

P: 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
Expert Mod 15k+
P: 16,027
'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.