:: Forum >>

Grid in IFRAME events

I dont mean to be a pest, but this one is puzzling me. Anyones help is appreciated. Here it is:

I have the grid in a iframe. I have the row indexes set with my db's ID's from a resultset. I am trapping the double click event using:
var row = new Active.Templates.Row;
row.setEvent("ondblclick", function(){this.action("myAction")});
obj.setTemplate("row", row);

obj.setAction("myAction", function(src){window.parent.rowClick(src.getProperty("item/index"))});

On the IFRAME Parent page the rowClick function I am calling grabs the id being passed fine. If I alert 'document.URL' is this function, the parent page's url shows as expected. However, if I try to change location in the this function, The relative url is gotten from the IFRAME's content page. So I cannot use document relative url's. Why is this? Is this because the event is actually coming from the IFRAMES contents, even though the function resides in the parent page? Is there any way around this so I can use a document relative url?

Any help from anyone is appreciated. I'm stumped on how to overcome this. Hopefully I made sense in my explaination.

Paul
Thursday, January 29, 2004
I just saw this post, and am wondering if its a related problem?
http://www.activewidgets.com/messages/311-7.htm
Paul
Thursday, January 29, 2004
Paul,

it makes sense to try the same patch. If it doesn't help, please let me know.
Alex (ActiveWidgets)
Friday, January 30, 2004
Alex,

I tried the patch for my situation above. It didn't work for me. I'm not sure what to try next.
Paul
Wednesday, February 4, 2004
OK, I also simulated a test witht the same layout and no grid code at all. The location change worked fine as expected. So this seems like a bug of some sort to me. Let me know what you think Alex. Thanks...
Paul
Wednesday, February 4, 2004
Yes, I can replicate this. Very strange indeed! I don't know yet why this happens but it looks like there is a work-around - if you put your window.location = ... code inside window.setTimeout() then the correct base url is used. But I will try to find the bug anyway...
Alex (ActiveWidgets)
Wednesday, February 4, 2004
Thanks for looking into it Alex.. it is a strange thing isn't it. Seems the work-around works.
Paul
Friday, February 6, 2004
I have exactly the same behaviour without any ActiveWidgets code at all. Just using <div onclick="window.parent.changeLocation()">...</div> inside the iframe. So it seems to be a browser 'feature' (IE 6.0.2800.1106...)
Alex (ActiveWidgets)
Saturday, February 7, 2004
huh?!? I could swear when I tried it, it worked.. But your probably right its a browser thing. Thanks for looking into it though. I'm using the workaround now.
Paul
Tuesday, February 10, 2004

This topic is archived.


Back to support forum

Forum search