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

Controlling Page Stack Using IE6

P: 35
My client-side application works reliably and as intended in Firefox, but not in IE6. The problem seems to be that I do not have control over the page stack in IE, while I do in Firefox. So far I have not figured out how to use “focus” to assure proper page sequencing.

Here is an overview of my client-side application. There are 6 screens that capture user-entered data. Screen 1 opens 2, which opens 3, which opens 4, which opens 5, which opens 6. Each screen requests the user to enter data before moving to the next screen. Data validation prevents moving to the next screen if errors are found or a required field is skipped. Each screen opens the subsequent screen by pressing the NEXT button. When the NEXT button is pressed, that screen is not closed, but stays open holding the data that was entered.

When screen 6 is reached, there is no NEXT button, because there is no screen following it. In place of a NEXT button, screen 6 shows a SAVE button. After data entry and validation in screen 6, pressing the SAVE button causes screen 6’s data to be passed to its parent (screen 5) and screen 6 is closed. Closing screen 6 leaves screen 5 showing at the top of the stack. Screen 5 now shows only a SAVE button (replacing the previously used NEXT button). Pressing the screen 5 SAVE button passes all data in 5 to 4 and closes 5, leaving 4 showing at the top of the stack. SAVE buttons are used for screens 4, 3, and 2 to move their respective data to screen 1, which at the end of the process is the only one remaining open. At that point a REPORT button appears to initiate reporting based on the data passed to 1 from screens 6, 5, 4, 3, and 2.

The reason that Firefox seems to control the stack properly is that when the NEXT button is pressed, Firefox opens each subsequent screen in a new tab. Thus when pressing the screen 6 SAVE button, 6 is closed and 5 immediately appears from behind it.

In contrast to Firefox, IE6 opens each screen in separate windows, not tabs. When pressing the screen 6 SAVE button, screen 5 is not always the next screen in the stack to appear, or if it is, then its parent (screen 4) is not always behind it in the stack.

What occurs to me are these possibilities:
(a) control the stack order so that it is always 6, 5, 4, 3, 2, 1; control by use of “focus” or some other javascript technique;
(b) make the screens open in IE in tabs so that the desired order is obtained (this assumes IE and Firefox would use tabs in the same manner);
(c) something else someone more experienced would suggest.

TIA for any ideas that work!!
Nov 20 '07 #1
Share this Question
Share on Google+
13 Replies


acoder
Expert Mod 15k+
P: 16,027
Since you're opening new windows, window.opener should refer to the parent window.
Nov 20 '07 #2

P: 35
Yes, window opener refers to each window's parent. Window 1 is parent to 2, 2 parent to 3, etc. Because of that relationship, things work fine in Firefox, but not in IE6.
Nov 20 '07 #3

acoder
Expert Mod 15k+
P: 16,027
If you try with fewer windows, does that work?

It may be a memory bug in IE6.

Personally, I prefer to avoid popup windows wherever possible. You could achieve the same functionality using DHTML (show and hide divs).
Nov 20 '07 #4

P: 35
I have not tried fewer windows. That would mean rewriting the whole application or else supporting multiple versions by browser.

I don't know DHTML at present, so I don't appreciate your suggestion of using the DIV tag. Does that mean you can make sections of your code occupy the same screen space, depending if it is visible or not? If so, it seems to me there must be reference points for the screen space to assure that the visible code stays where needed. Is that correct?
Nov 20 '07 #5

acoder
Expert Mod 15k+
P: 16,027
Does that mean you can make sections of your code occupy the same screen space, depending if it is visible or not? If so, it seems to me there must be reference points for the screen space to assure that the visible code stays where needed. Is that correct?
You only need to set the position of the divs. If you set the 'left' and 'top' properties, they will be displayed at the required positions.
Nov 20 '07 #6

P: 35
Thanks for the DIV tag reply. I will have to study how that works.

[Quote by Acoder] It may be a memory bug in IE6. [/quote]

Should I infer from the above remark you made that using "window.opener" should assure the right page order in the stack?

Also, do you know if there is a way to programatically cause a window to open as a tab rather than a separate window?
Nov 20 '07 #7

acoder
Expert Mod 15k+
P: 16,027
Should I infer from the above remark you made that using "window.opener" should assure the right page order in the stack?
It should do as far as I'm aware (unless you've discovered a new bug!)
Also, do you know if there is a way to programatically cause a window to open as a tab rather than a separate window?
I'm afraid not. This is a browser issue which JavaScript has no control over. In any case, I don't think IE6 supports tabs.
Nov 20 '07 #8

P: 35
It should do as far as I'm aware (unless you've discovered a new bug!)
I'm afraid not. This is a browser issue which JavaScript has no control over. In any case, I don't think IE6 supports tabs.
Well, thanks for taking the time to have this conversation. I don't know yet what I am going to do other than indicate a preference for Firefox over other browsers.

I guess there is nothing more to do with this thread, unless someone else jumps in with other ideas.

I appreciate your help and insights.
Nov 20 '07 #9

gits
Expert Mod 5K+
P: 5,352
hi ...

a browser preference wouldn't really solve the problem :) ... i know that it is easy to say: 'recode your application' but i think the solution to prefer would be the DIV-solution that acoder already propsed. it is quite simple to create 6 divs at one page that contain all of the 6 seperate window-contents you already have. now you could use the css-property 'display: none' for div 2 to 6 and only div 1 is displayed at the page. now we could create a javascript toggle function that switches the visibility of the corresponding div the way you need it and it would result in a 'one-page-layout' that also would be a little bit better to handle then a multiwindow layout ... in case you want to give that a try post back and we may help you with that ...

kind regards
Nov 20 '07 #10

acoder
Expert Mod 15k+
P: 16,027
In case you needed more convincing:
  1. Less memory-intensive
  2. No need to worry about popup blockers
  3. No need to worry about 'lost' or accidentally closed windows (resulting in undefined errors)
  4. Get rid of this IE6 bug in one fell swoop
  5. Self-contained
  6. Not too difficult to recode - just place the body code into each div (making sure no ids clash) and the rest appears in the head section
Nov 21 '07 #11

gits
Expert Mod 5K+
P: 5,352
In case you needed more convincing:
  1. Less memory-intensive
  2. No need to worry about popup blockers
  3. No need to worry about 'lost' or accidentally closed windows (resulting in undefined errors)
  4. Get rid of this IE6 bug in one fell swoop
  5. Self-contained
  6. Not too difficult to recode - just place the body code into each div (making sure no ids clash) and the rest appears in the head section
:) that should convince everybody ...
Nov 21 '07 #12

P: 35
hi ...

a browser preference wouldn't really solve the problem :) ... i know that it is easy to say: 'recode your application' but i think the solution to prefer would be the DIV-solution that acoder already propsed. it is quite simple to create 6 divs at one page that contain all of the 6 seperate window-contents you already have. now you could use the css-property 'display: none' for div 2 to 6 and only div 1 is displayed at the page. now we could create a javascript toggle function that switches the visibility of the corresponding div the way you need it and it would result in a 'one-page-layout' that also would be a little bit better to handle then a multiwindow layout ... in case you want to give that a try post back and we may help you with that ...

kind regards
Thanks to GITS and ACODER for your most recent replies (yesterday and today).

1. Yes, I am interested to learn how to use the DIV tag along the lines you suggest above. So I do appreciate the plan outlined by you both. I will try to work on that as time permits. I agree with the concept, because there is a lot of "window.opener" code that could be dropped from my present scheme. So when done, things should be simpler.

2. Time is of the essence due to upcoming holidays, other commitments, and the fact that in January the application must be used. So I will not be able to install the DIV solution until a future version of the application.

3. I can report that yesterday afternoon I learned how to use the "focus()" method in my project with the result that the application now works in IE6 as well as it does in Firefox.

4. Some months ago GITS recommended using Javascript, the Definitive Guide by David Flanagan. It proved very helpful in rethinking my code and getting it to work. Part of my difficulty is getting the right perspective when working with the different screens. So in this case there is no IE6 bug that I stumbled over. Rather it was my inexperience with javascript and object oriented programming that blinded my initial effort. Basically, I just had to find the right place and time to invoke the focus method.

Having said all the above I do wish to thank you both strongly for you patience and willingness to help an inexperienced and newcomer to the world of javascript programming. I much appreciate you both!!
Nov 21 '07 #13

acoder
Expert Mod 15k+
P: 16,027
3. I can report that yesterday afternoon I learned how to use the "focus()" method in my project with the result that the application now works in IE6 as well as it does in Firefox.
Oh, just a focus() problem. Glad you solved it.
Having said all the above I do wish to thank you both strongly for you patience and willingness to help an inexperienced and newcomer to the world of javascript programming. I much appreciate you both!!
No problem and good luck with the rest of your project.
Nov 21 '07 #14

Post your reply

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