Board Logo

OnItemOpenHandler
leonardhome - 2/8/2005 at 03:13 PM

I am trying to use the value of the variable "myitemtext" on another page in my frameset, but on the other page it reports "undefined". An alert in tree.tpl reports the correct value. I've included the code I'm using in my tree.tpl file below. Is it possible to do this?
Am I missing a basic javascript concept?

function OnItemOpenHandler (o_item) {
if (o_item.a_config[2] && o_item.a_config[2]['myID']) {
var n_myID = o_item.a_config[2]['myID'];
myitemtext = n_myID;
alert(myitemtext);
parent.setTextLink(myitemtext);
return true;
}
}

Thanks in advance for any help!


jshuusko - 2/13/2005 at 09:02 PM

You should refer to the variable with the frame name or number.

alert(top.frames['theOtherFrame'].myitemtext);


leonardhome - 2/16/2005 at 08:13 PM

Thanks for the suggestion.

I was able to fix my variable problem by declaring it as a global variable. In my haste to get this working I didn't look close enough at my own code.

Thanks again.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/