1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    3
    Vote Rating
    0
    Sudha1807 is on a distinguished road

      0  

    Default Two tab panel in a FormPanel

    Two tab panel in a FormPanel


    Hi,

    In a FormPanel I included two TabPanles and gave activeTab as zero for both the panel but having problem to view first panel. How to activate zero tab on both the panels?
    Thank You

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    What specifically are you having problems with? I don't have any problems placing two TabPanels in a FormPanel.

    In general, to select the first tab, use tabPanel.setSelection(tabPanel.getItem(0)). Here's a short code example I wrote to test for your problem.

    Code:
    public class TabPanelMan implements EntryPoint {
    
      /**
       * Creates a tab item containing a single button. The item and the button are
       * labelled with the provided integer.
       * 
       * @param a The integer use in the label
       * @return The constructed tab item
       */
      private static TabItem createTabItem(int a) {
        TabItem item = new TabItem("Item " + a);
        item.add(new Button("Button " + a));
        return item;
      }
    
      @Override
      public void onModuleLoad() {
        // Create the form panel
        FormPanel form = new FormPanel();
    
        // Create the first tab panel and five tabs
        final TabPanel tabPanelTop = new TabPanel();
        tabPanelTop.setAutoHeight(true);
        for (int i = 0; i < 5; i++)
          tabPanelTop.add(createTabItem(i));
    
        // Add it to the form
        form.add(tabPanelTop);
    
        // Create the second tab panel and five tabs
        TabPanel tabPanelBottom = new TabPanel();
        tabPanelBottom.setAutoHeight(true);
        for (int i = 5; i < 10; i++)
          tabPanelBottom.add(createTabItem(i));
    
        // Add it to the form
        form.add(tabPanelBottom);
    
        // Add the form to the page
        RootPanel.get().add(form);
    
        // Also add a button that selects the first tab
        RootPanel.get().add(new Button("Select Item 0", new SelectionListener<ButtonEvent>() {
    
          @Override
          public void componentSelected(ButtonEvent ce) {
            tabPanelTop.setSelection(tabPanelTop.getItem(0));
          }
    
        }));
      }
    
    }
    If you're still having problems, post a short code sample showing what the problem is, or go into some more detail about what exactly isn't rendering properly.

  3. #3
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    226
    Vote Rating
    3
    The_Jackal is on a distinguished road

      0  

    Default


    Not sure if this is related to your issue, but I found a quirk with tabs on a form; validation will not check tabs that have not been clicked on. This is due the default deferred rendering. To have validation check all tabs set deferredRender to false:
    Code:
    TabPanel tabs = new TabPanel();
    tabs.setDeferredRender(false)

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar