Welcome Guest Search | Active Topics | Sign In | Register

How do I set focus to a control located in a callbackpanel located in a pageview Options
gmyroup
Posted: Wednesday, August 26, 2009 1:34:18 PM
Rank: Advanced Member
Groups: Member

Joined: 7/26/2009
Posts: 36
I am trying to set focus to an asp.net textbox which is located within a callbackpanel which itself is located within one of your pageview.

I'm using the following javascript but without any success.

function btnAddNoteClick()
{
setTimeout(
function()
{
document.JobCoachHomePageForm.TextBox1.focus();
}, 100);
}
eo_support
Posted: Wednesday, August 26, 2009 1:37:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Your set focus code is fine except that it will only work on IE. On other browser you will need to call document.getElementById to get a reference of the textbox object.

I do not know when you call this code though. You should be calling it AFTER the callback is done, which usually means handling the CallbackPanel's ClientSideAfterUpdate event and then call the set focus code from within that handler.

Thanks
gmyroup
Posted: Wednesday, August 26, 2009 2:00:49 PM
Rank: Advanced Member
Groups: Member

Joined: 7/26/2009
Posts: 36
Please forgive me if my questions sound green... I have no experience using javascript and your client side event handlers.

If I want to call the javascript function from the callbackpanels ClientSideAfterUpdate event do I simply type the javascript function's name ( btnAddNoteClick() ) in the control properties exposed with Visual Studio OR do I type the javascript code?

I tried typing btnAddNoteClick() in the CallbackPanel's ClientSideAfterUpdate property but it does not fire.
eo_support
Posted: Wednesday, August 26, 2009 2:05:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You should type in the function name only. Please see here for more details:

http://doc.essentialobjects.com/library/1/clientapi_howto.aspx

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.