PDA

View Full Version : Problems with focus


elcaro2k
09-30-2002, 04:24 PM
I am having problems setting focus on a page. Here is the scenario.
I open page B from page A.
When page B opens I want the window containing page A to goto page C and the focus to remain on page B.

What is happening is that page B opens and then when page A goes to C so does the focus?

Thanks
Ray

whackaxe
09-30-2002, 04:33 PM
try a timeout on page B (the open one right?)

<script>
settimeout("window.focus()", 2000)
</script>
that will wait 2 seconds (or 200 mili seconds) and change the focus to itslef

adios
09-30-2002, 04:39 PM
Well, it's setTimeout, and that's not the way to do it. Just put this in page c:

<body onload="this.blur()">

btw you should distinguish between opening 'pages' in already opened windows, and opening a new window. Nobody seems to bother doing this.

whackaxe
09-30-2002, 04:49 PM
yeah but when page C loses the focus will it automaticly go to B or maybe another application or window? u sure its setTimeout, i think it works with just smallcaps

elcaro2k
09-30-2002, 05:01 PM
It is setTimeout and that works. JavaScript IS case sensitive.

I can't use the blur on page C because I cannot edit C. It's a Cognos cube that I cannot change. Therefore I have to do it from A or B.

Thanks for the help!!!
Ray

requestcode
09-30-2002, 06:04 PM
If you can edit page B the you could place this in the body tag:
onBlur="this.focus()"

The problem is that if you want to minimize the window containing page B it will not allow it.