Uploaded image for project: 'Click'
  1. Click
  2. CLK-725

ActivePanel value in TabbedPanel always set to first panel

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.2.0
    • None
    • extras
    • None

    Description

      I have created a Page which contains a TabbedPanel. There are two tabs, each which is another Panel instance called Panel1 and Panel2. Panel1 and Panel2 both contain a Form. The resulting page contains two tabs, each tab with its own form. The forms have different names to assure they are unique when the panels are put together.

      The first tabbed panel works correctly – clicking the submit button results in the callback for that form. However, when I click on the submit for the second tab, the callback is not invoked. I debugged this issue some, and found that the first tabbed panel is always the "Active Panel". This is happening because the first panel to be added to the TabbedPanel is made active:

      public Control insert(Control control, int index) {
      ....
      if (getPanels().size() == 1)

      { setActivePanel(panel); }

      After adding the 2nd panel, if I make an additional call to setActivePanel(panel2) then the callback is invoked:

      Panel panel1 = new Panel1("Tab1");
      tabbedPanel.add(panel1);

      Panel panel2 = new Panel2("Tab2");
      tabbedPanel.add(panel2);

      tabbedPanel.setActivePanel(panel2);

      I presume that the 2nd panel should be internally made active based upon which form was submitted?

      Attachments

        Activity

          People

            Unassigned Unassigned
            kyleschlosser Kyle Schlosser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment