[CLOSED] Event change tabpanel

  1. #1

    [CLOSED] Event change tabpanel

    Hi,

    I have a little problem. I create many panels dynamics to TabPanel and each panel contains a grid also dynamic. All grids share the same contextmenu not dynamic. The control TabPanel is not dynamic.
    I do not want to create the context menu for each grid.
    In the event of changing the tabs I wanted to capture some variable or attribute and hide some menu items. Each menu should contain specific itens.

    this not work:
    <ext:TabPanel ID="TabPanelGeral" runat="server" Region="Center" Margins="0 4 4 0" EnableTabScroll="true" LayoutOnTabChange="true" Title="Bem vindo"> 
                        <DirectEvents>
                            <BeforeTabChange OnEvent="TrocarTab_Change">
                                <ExtraParams>
                                    <ext:Parameter 
                                            Name="tipoDocumentoID"
                                            Value="#{TabPanelGeral}.getActiveTab()"                                                           
                                            Mode="Raw"/>                                              
                                </ExtraParams>
                                <EventMask ShowMask="true" Msg="Aguarde ..." MinDelay="600" />                                                     
                            </BeforeTabChange>
                        </DirectEvents> 
                        <Items>
                            <ext:Panel ID="PanelBemVindo" runat="server" Icon="House" Padding="10" Title="Bem vindo">
                                <AutoLoad Url="../Uteis/index.html" Mode="IFrame"  ShowMask="true" MaskMsg = "Carregando ..." />
                            </ext:Panel>                                                
                        </Items>                    
                        *<Plugins>
    ***************        <ext:TabMenu ID="TabMenuPanelGeral" runat="server"  />
    ***********        </Plugins>
                    </ext:TabPanel>
    The tabs are not added in the controls in the page init event.

    Any suggestion?

    Thanks!
    Last edited by Daniil; Oct 12, 2011 at 3:57 PM. Reason: [CLOSED]
  2. #2
    Can you provide more details? How grid's context menu is related with TabMenu plugin?
    It is clear that you want show/hide some menu items for activated tab but you did not describe what problems do you have with that task
  3. #3
    Hi,

    Any more details about "this not work" would be appreciated. Any errors, exceptions or don't you just get a desired result?

    Quote Originally Posted by stoque View Post
    this not work:
    <ext:TabPanel ID="TabPanelGeral" runat="server" Region="Center" Margins="0 4 4 0" EnableTabScroll="true" LayoutOnTabChange="true" Title="Bem vindo"> 
                        <DirectEvents>
                            <BeforeTabChange OnEvent="TrocarTab_Change">
                                <ExtraParams>
                                    <ext:Parameter 
                                            Name="tipoDocumentoID"
                                            Value="#{TabPanelGeral}.getActiveTab()"                                                           
                                            Mode="Raw"/>                                              
                                </ExtraParams>
                                <EventMask ShowMask="true" Msg="Aguarde ..." MinDelay="600" />                                                     
                            </BeforeTabChange>
                        </DirectEvents> 
                        <Items>
                            <ext:Panel ID="PanelBemVindo" runat="server" Icon="House" Padding="10" Title="Bem vindo">
                                <AutoLoad Url="../Uteis/index.html" Mode="IFrame"  ShowMask="true" MaskMsg = "Carregando ..." />
                            </ext:Panel>                                                
                        </Items>                    
                        *<Plugins>
    ***************        <ext:TabMenu ID="TabMenuPanelGeral" runat="server"  />
    ***********        </Plugins>
                    </ext:TabPanel>
    One thing I can say about:
    <ext:Parameter
         Name="tipoDocumentoID"
         Value="#{TabPanelGeral}.getActiveTab()"                                                            
         Mode="Raw"
         />
    You are trying to pass a whole tab object, not its id. I think there will be a recursion error during that tab encoding.

    As well, .getActiveTab() returns a previous tab, but, I guess, you need a new tab.

    So, please try:
    <ext:Parameter
         Name="tipoDocumentoID"
         Value="newTab.id"                                                            
         Mode="Raw"
         />
    Please don't forget that it's a client side id, not server.
  4. #4
    The tabs "Edicao1" and Edicao 2 the image below each a has grid. All my grids share the same context menu. But for all grid I need to disable specific menu items. I wanted the event to change the menu, to capture the active tab and move the same as the id parameter. The idea would be something like:
    #{TabPanelGeral}.GetActiveTab().GetControlID.
    I did not want to create a context menu for each grid. How do I add the dynamic controls in page's controls, I can not recover the tabs in the codebehind.

    Click image for larger version. 

Name:	teste.png 
Views:	125 
Size:	20.8 KB 
ID:	3314

    The erros is because I'm going through a tab as a parameter, but I need to pass the id of this tab.
    Does that help?
  5. #5
    I wanted the event to change the menu, to capture the active tab and move the same as the id parameter.
    Use TabChange event, but you cannot pass controls as extra parameter (I don't understand why do you need it)

    How do I add the dynamic controls in page's controls, I can not recover the tabs in the codebehind.
    Any dynamic control must be recreated on the server side for each request (it is ASP.NET requirement)
  6. #6
    Hi Vladimir,

    Use TabChange event, but you cannot pass controls as extra parameter (I don't understand why do you need it)
    I need to pass the ID of the control, not control.
    Because when I create the control I concatenate the ID like this:
    string.Concat("Panel_", id.Tostring())
    I need to retrieve this id.tostring in the code behind. With this id I set the items of menu context.

    Any dynamic control must be recreated on the server side for each request (it is ASP.NET requirement)
    I know this is ASP.NET requirement, but I thought as the control is rendered I could recover your id with ext.js or javascript. Why I wanted to pass the id as extra parameter.
  7. #7
    To pass the tab id use the foolowing extra paramter of TabChange direct event
    <ext:Parameter
         Name="tabId"
         Value="tab.id"                                                           
         Mode="Raw"
         />

Similar Threads

  1. [CLOSED] Error in ext.axd on tabpanel change
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 23, 2012, 1:58 PM
  2. Replies: 2
    Last Post: Jun 16, 2011, 1:41 AM
  3. Change Event then Click event : issue
    By jeybonnet in forum 1.x Help
    Replies: 2
    Last Post: May 28, 2010, 1:19 PM
  4. [CLOSED] How to change a TabPanel using CSS? [VID]
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 11, 2010, 3:11 PM
  5. Tabpanel / Tab activate event
    By locoperoguapo in forum 1.x Help
    Replies: 1
    Last Post: Feb 17, 2009, 1:09 PM

Tags for this Thread

Posting Permissions