[CLOSED] Tab activate event

  1. #1

    [CLOSED] Tab activate event

    Hi,

    I have created a bunch of tabs, each with their own iframe. The iframes are loaded when the "activate" direct event is fired. eg

    
            <a href="#" onclick="#{_tabPanel1}.setActiveTab(#{_tab3});#{_tab3}.reload();">load tab 3</a>
    
            <br /><br /><br /><br />
    
            <ext:TabPanel ID="_tabPanel1" runat="server" AutoHeight="true" Border="true" AutoWidth="true" EnableTabScroll="true">
                <Items>
                    <ext:Panel  
                        ID="_tab1"
                        runat="server" 
                        Height="470"
                        Title="Tab 1">
                    </ext:Panel>
                    <ext:Panel  
                        ID="_tab2"
                        runat="server" 
                        Height="470"
                        Title="Tab 2">
                    </ext:Panel>
                    <ext:Panel 
                        ID="_tab3" 
                        runat="server" 
                        Height="470"
                        Title="Tab 3">
                        <DirectEvents>
                            <Activate OnEvent="ActivatePlease" Timeout="60000">
                                <EventMask ShowMask="true" MinDelay="150" Msg="activating..." />
                                <ExtraParams>
                                    <ext:Parameter Name="AccountId" Value="123456" />
                                </ExtraParams>
                            </Activate>   
                        </DirectEvents>
                    </ext:Panel>
                </Items>
                <CustomConfig><ext:ConfigItem Name="idDelimiter" Value="$$" Mode="Value" /></CustomConfig>
            </ext:TabPanel>
    
            protected void ActivatePlease(object sender, DirectEventArgs e)
            {
                var accountId = e.ExtraParams["AccountId"];
                if (!String.IsNullOrEmpty(accountId))
                {
                    _tab3.LoadContent(new LoadConfig("http://www.google.co.uk", LoadMode.IFrame, false));
                }
            }
    This code works fine if the tab i wish to go to is not already activated/selected

    However if i want to refresh the iframe within the tab, what client side method do i need to call? Alternatively, what directevent event should i be calling when i do a reload client side? Please note that if i use the "Update" directevent, the iframe keeps refreshing itself every couple of seconds.

    Many Thanks

    Lee
    Last edited by geoffrey.mcgill; Aug 02, 2010 at 5:20 AM.
  2. #2
    hmmm, I don't understand what you are asking for here. Do you just want to reload the Tab? If yes, then call .reload() on the Tab object.

    If you want to perform some action on the server-side and not use a DirectEvent, you could configure a DirectMethod.

    More information is required.
    Geoffrey McGill
    Founder
  3. #3
    Hi Geoffrey,

    The .reload() method just refreshes the iframe. I want to call a direct event to reload a different iframe within the tab that is currently active.

    The Activate DirectEvent is fired when i select the tab, however if i am already on a tab i wish to reactivate, i am not sure what DirectEvent i should be using. At the same time i am curious as to whether a client side method can reactivate my tab.

    Hope that has cleared any confusion.

    Lee
  4. #4
    Hi,

    You have to set ReloadOnEvent="true" and TriggerEvent="show" for the AutoLoad
    Please see the following sample ("Loading on Show with Reloading" tab)
    https://examples1.ext.net/#/Panel/Ba...erred_Loading/
  5. #5
    Thanks Vlad,

    Works a treat!! :o

Similar Threads

  1. Replies: 1
    Last Post: May 18, 2012, 1:52 PM
  2. [CLOSED] Add Activate Event to dynamically created tabs
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 02, 2011, 5:37 PM
  3. [CLOSED] Adding Activate Event to tabs throwing error
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 17, 2011, 8:54 AM
  4. [CLOSED] Make enter key activate button click direct event
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 15, 2010, 6:02 PM
  5. Tabpanel / Tab activate event
    By locoperoguapo in forum 1.x Help
    Replies: 1
    Last Post: Feb 17, 2009, 1:09 PM

Posting Permissions