|
Rank: Member Groups: Member
Joined: 6/8/2007 Posts: 13
|
I am looking at executing a javascript function when a tab is clicked or a multipage becomes visible. Is there an event that will execute the javascript function when a multipage becomes visible and when it becomes invisible?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Kevin,
What you are looking for is ClientSideOnItemClick event on the TabStrip control. It is called everytime a tab item is clicked. You can find an example on how to use this feature in our online demo, under menu client side event handling section. Handling client side event for menu and for tabstrip are essentially the same.
Please feel free to let us know if you still have any questions.
Thanks
|
|
Rank: Member Groups: Member
Joined: 6/8/2007 Posts: 13
|
This is close to what I need but not quite. I am trying to display tabs with a multipage control. When a multipage becomes visible I want to run a function to update an input box on that page and then when that multipage is hidden and another multipage becomes visible I need to execute the javascript function when the hidden page occurs and when the new page becomes visible.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Don't you use a TabStrip to switch pages in the MultiPage control? If you do, then when the MultiPage switches pages, the TabStrip's ClientSideOnItemClick get called. Inside that handler you can can do:
Code: JavaScript
function tabstrip_onclick(e, info)
{
window.setTimeout("check_multipage()", 10);
}
var g_oldPageIndex = null;
function check_multipage()
{
var mp = eo_GetObject("MultiPage1");
var newIndex = mp.getSelectedIndex();
if (newIndex != g_oldPageIndex)
{
if (g_oldPageIndex != null)
{
//the old tab page has just been hidden, do something you need
//to do when the page is being hidden here
}
g_oldPageIndex = newIndex;
//the new tab page has just been displayed, do something you need
//to do when the page is displayed here
}
}
Note you can not call check_multipage inside tabstrip_onclick because at that time the MultiPage has not switched to the new page yet.
|
|