| || |
GetFocus() Gives Error...
I am trying to get the object that has the focus on the page and it gives me GetFocus not defined error..
eg: I am entering a <Tab> key in a TextField and want to get the next object that has focus...
here's the sample code..
[ ] this.TypeKeys("<Tab>")
[ ] w3 = this.GetParent()
[ ] w4 = w3.GetFocus()
Re: GetFocus() Gives Error...
GetFocus only works on a WINDOW/DIALOG. Based on your example, if THIS is a textfield and it too has a parent (defined as GrandParent.Parent.theTextField, or more life like is window.pagelist.textfield) the result of THIS.GetParent() is acutally GrandParent.Parent. So you cannot do a GetFocus on that...only on the GrandParent. Best bet is to print out what w3 equals and it can only be GrandParent. (window or dialog) If you wanna find the grandparent, use
method to get the first item in the window name as a string.