Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
setFocus() problems
obradoa
For some reason, I can't get setFocus() to work. I am using TS6.1
I have this piece of code:
var oImage=IWDatacapture.getItem("/Image_Title");
oImage.setReadOnly(false);
oImage.setVisible(true);
oImage.setFocus();
And I get an error message when this line is present:
oImage.setFocus();
Here is the error message from IE6:
Line:961
Char: 5
Error: 'datacapture' is undefined
Code: 0
I don't have anything named 'datacapture' in my script.
Any ideas?
Thanks!
Find more posts tagged with
Comments
Migrateduser
It looks like setFocus() is being called before the entire form has loaded. Try putting your setFocus() call in a "onFormInit" handler. For example:
IWEventRegistry.addFormHandler("onFormInit",init);
...
function init()
{
var oImage=IWDatacapture.getItem("/Image_Title");
oImage.setReadOnly(false);
oImage.setVisible(true);
oImage.setFocus();
}
--Daniel