473,695 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Window.focus() (or window.print()) problem with XP/SP2 ?

5 New Member
Didn't get answer with google and in my regular forum. Came across this site and posting here. Your help will be highly appreciated !

Our application have frames - MainNav, TaskNave and Content. When print button is clicked, it prints only the Content (obviously top.Content.foc us() is in the code before window.print()) . We were using windows 2000 & IE6 for years. Recently, our installation updated users machines with XP SP2. Now when print button is clicked, all three frames get printed in 3 pages. Same application, if used from XP SP2, 3 pages gets printed where as when used from W2K, only 1 page is printed. I looked all over place, didn't find any information on focus not working correctly with XP SP2. I tried so many things but no luck. Please help!
MainNav.jsp
--
<TD><A tabIndex=-1 href=#><IMG SRC="<%= imagePath %>/images/button_print.gi f" ALT="Print" onClick="if (window.print) { top.Content.foc us(); window.print(); }" border="0"></A></TD>
--
frameset.jsp
--
<FRAMESET ROWS="134,*" border="0" onload="resetTi mer();" onunload="exitA lertWindow();">
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="MainNav" SRC="<%= commandPath %>/CSES/Main/displayMainNav" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="no" FRAMEBORDER="0" NORESIZE TABINDEX="-1">
<FRAMESET COLS="180,588,* " border="0">
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="TaskNav" SRC="<%= commandPath %>/CSES/Main/displayTaskNav" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="auto " class=TA FRAMEBORDER="0" NORESIZE TABINDEX="-1">
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="Content" SRC="<%= commandPath %>/CSES/Main/displayWelcome< %= strMiscMessage %>" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="auto " FRAMEBORDER="0" NORESIZE>
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="Blank" SRC="<%= imagePath %>/common/blankPage.html" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="no" FRAMEBORDER="0" NORESIZE>
</FRAMESET>

Now what I found:

On onclick for print, when I change top.Content.foc us(); to top.MainNav.foc us() it does print only MainNav; if I change to top.TaskNav.foc us() it prints only TaskNav, but when I change to top.Blank.focus (), this prints multiple pages just like top.Content.foc us().

So what I know is focus() does work on other 2 frames, but not on Content and Blank with XP SP2. With W2K IE6, everything works fine.

Tried changing the name of Content to something else, still didn't work. The site is intranet.

Any one has any idea what might be the reason that this code broke in XP SP2. Thanks.
Mar 5 '07 #1
8 4066
pronerd
392 Recognized Expert Contributor
What is the status of the "Blank" frame when it is being printed? If its visiblity or other CSS attributes are set to make it not visible then this could be why it is printing the entire frameset instead of just that frame. i.e. IE might be trying to print that page, but when it goes there and sees there is nothing to print it assumes you must want to print the frameset content since there would be no point in trying to print a blank page.
Mar 5 '07 #2
makunag
5 New Member
Ok, blank is visible. The problem happens in both, Content and Blank. For both entire frameset is printed.
I tried few more things, and might be close - but still not there. Need your help.

1) I started playing with the frame order on frameset. Now when I put Blank at the left most, then TaskNav and then Content - and try focus on each of them on by one for printing - Now Blank printed correctly, TaskNav printed correctly but for Content every frames printed.

2) Changed order again, Now Blank, Content and TaskNav - This time all 3 printed correctly.

--> The conclusion I drawn is what ever frame is put after TaskNav, it cannot focus and print just that frame.

So something to do with TaskNav.jsp.

--> TaskNav.jsp is a long jsp with all the left menu items with their links. I made it a blank jsp with hardly anything in it. Now everything works fine, even the frames after the TaskNav.

Now I started putting the code in TaskNav.jsp one section of menu at a time, and test the print. I saw that after few sections, at one point it stops working. No matter what code I put. Is this has anything to do with the length of jsp??

Again the same code works fine with SP1 but XP/SP2 seems to have problem. Can you suggest anything I can try?

Thanks a lot.
Mar 5 '07 #3
sumittyagi
202 Recognized Expert New Member
Didn't get answer with google and in my regular forum. Came across this site and posting here. Your help will be highly appreciated !

Our application have frames - MainNav, TaskNave and Content. When print button is clicked, it prints only the Content (obviously top.Content.foc us() is in the code before window.print()) . We were using windows 2000 & IE6 for years. Recently, our installation updated users machines with XP SP2. Now when print button is clicked, all three frames get printed in 3 pages. Same application, if used from XP SP2, 3 pages gets printed where as when used from W2K, only 1 page is printed. I looked all over place, didn't find any information on focus not working correctly with XP SP2. I tried so many things but no luck. Please help!
MainNav.jsp
--
<TD><A tabIndex=-1 href=#><IMG SRC="<%= imagePath %>/images/button_print.gi f" ALT="Print" onClick="if (window.print) { top.Content.foc us(); window.print(); }" border="0"></A></TD>
--
frameset.jsp
--
<FRAMESET ROWS="134,*" border="0" onload="resetTi mer();" onunload="exitA lertWindow();">
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="MainNav" SRC="<%= commandPath %>/CSES/Main/displayMainNav" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="no" FRAMEBORDER="0" NORESIZE TABINDEX="-1">
<FRAMESET COLS="180,588,* " border="0">
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="TaskNav" SRC="<%= commandPath %>/CSES/Main/displayTaskNav" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="auto " class=TA FRAMEBORDER="0" NORESIZE TABINDEX="-1">
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="Content" SRC="<%= commandPath %>/CSES/Main/displayWelcome< %= strMiscMessage %>" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="auto " FRAMEBORDER="0" NORESIZE>
<FRAME ONREADYSTATECHA NGE="hidepane() ;" NAME="Blank" SRC="<%= imagePath %>/common/blankPage.html" MARGINWIDTH="0" MARGINHEIGHT="0 " SCROLLING="no" FRAMEBORDER="0" NORESIZE>
</FRAMESET>

Now what I found:

On onclick for print, when I change top.Content.foc us(); to top.MainNav.foc us() it does print only MainNav; if I change to top.TaskNav.foc us() it prints only TaskNav, but when I change to top.Blank.focus (), this prints multiple pages just like top.Content.foc us().

So what I know is focus() does work on other 2 frames, but not on Content and Blank with XP SP2. With W2K IE6, everything works fine.

Tried changing the name of Content to something else, still didn't work. The site is intranet.

Any one has any idea what might be the reason that this code broke in XP SP2. Thanks.

Ok then try this:
window.frames["content"].print();
Mar 6 '07 #4
sumittyagi
202 Recognized Expert New Member
Ok then try this:
window.frames["content"].print();
sorry I rectify myself:
top.frames["content"].print();
Mar 6 '07 #5
makunag
5 New Member
Sorry, didn't work ! Any other idea ?
sorry I rectify myself:
top.frames["content"].print();
Mar 6 '07 #6
makunag
5 New Member
Any one ? Seems like its the lenght of jps (TaskNav.jsp). If I take out some code out of TaskNav.jsp, the print of Content works. Kind of wierd. I don't see any errors on the code of TaskNav. Just menus coded in jsp tags.
Any one know any relation of length of jsp (means, long code in jsp) with the focus/print or frame problem ?
Mar 7 '07 #7
Joon125
1 New Member
Hi,

I also have got the same problem with our intranet-application after we installed XP/SP2 :-(

I try to print a frame with a PDF. With SP1 this worked fine (set focus on the corresponding frame and then print () ). with SP2 I only get an empty page with the printed link to the file on the server. :-(


Does anybody find a solution for this problem?
Mar 12 '07 #8
makunag
5 New Member
Good to know that its just not me...
One more thing I like to add, forget my print button. If I right click the frame I want to print (Content) and do print, it still prints all 3 frames....
Any one ?
Hi,

I also have got the same problem with our intranet-application after we installed XP/SP2 :-(

I try to print a frame with a PDF. With SP1 this worked fine (set focus on the corresponding frame and then print () ). with SP2 I only get an empty page with the printed link to the file on the server. :-(


Does anybody find a solution for this problem?
Mar 12 '07 #9

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

Similar topics

2
4216
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing windows to the front (top) in Netscape, IE and Opera. However, this command does nothing when you access the web page through AOL, even though they say this is IE. Once a window is behind (blurred), I have been unable to bring it back to the front...
1
1381
by: CES | last post by:
All, I'm trying to test if a browser is configured so that I can use popup windows or if it has a popup blocker installed... the only solution I was able to think of, was one that would pop up a window and then write a value of popup=true into a form box (or cookie) and then submits the page. The code below executes up to the point where the window regains focus window.focus() but fails to execute any code after that point, specifically...
5
2063
by: Wei | last post by:
I need the current window stay on focus. The user will have to click on exit button to exit the window. How can I do this in asp.net in C#? Thank you
4
3596
by: Csaba Gabor | last post by:
Up until a few weeks ago, javascript code like window.open("http://mydomain.com", "windowName"); would always bring my new or reused window to the top, with focus. Lately, Firefox (Deer park alpha 2) only brings it to the top if the window is new. If it's being reused, the window does not come to the foreground (with IE 6 it does). Is there a new way in Mozilla/Firefox that I can ensure that this
0
1803
by: Peter TB Brett | last post by:
Hi folks, I'm currently trying to work out how to detect when a PyGTK window receives the focus from the window manager -- I assume that it must receive some kind of X event, but I can't work out which signal it generates. Searching around the subject on the web doesn't seem to pull up anything useful. I tried the "focus" signal, but that doesn't work the way I'd like it to. For example, the following code only prints the message...
4
68028
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between these forms that may make one succeed and another fail? In particular, this.window.focus() fails in Opera 9.10 with an "object not found", and windows.focus() succeeds in Opera 9.10, Firefox 2.02, and IE 7.
4
4050
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the user looking at window A clicks the "open window B" link, I want
3
17945
by: acehigh1983 | last post by:
Is it possible to focus a window in firefox and safari?? i have a webpage that opens another window, it then focuses on the original window (the new window that opened now behind it in the background). In IE it works fine but in firefox and safari it doesn't focus on the original page. I have looked on all sorts of forums etc and apparently FF and Safari block script that uses window.focus(); So just wondering if there is another way to...
4
2218
by: Spizzat2 | last post by:
I'm trying to figure out a workaround to a minor annoyance that I'm coming up with while coding a site. I've got some keyboard shortcuts set up for the site via javascript, and when I press escape, it's set to hide several divs on the page, and remove focus from a link. Unfortunately, I don't know which link will have focus, so I can't just blur a particular element (that I'm aware of) since I won't know which element it is. I got it...
0
8623
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9113
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8977
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6488
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5837
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4339
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
1971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.