Welcome Guest Search | Active Topics | Sign In | Register

MultiPage and javascript Options
Kevin Hoot
Posted: Friday, June 8, 2007 6:55:14 AM
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?
eo_support
Posted: Friday, June 8, 2007 7:00:42 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
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
Kevin Hoot
Posted: Friday, June 8, 2007 7:33:16 AM
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.
eo_support
Posted: Friday, June 8, 2007 7:51:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
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.


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.