Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Remove tab not working as expected

    Hi ,

    I need to implement the business logic in such a way ,
    • Close the tab based on background logic
    • Add the same tab whenever needed by menu driven approach

    From the (i) specification, while closing the tab the near by tab are getting blank canvas.
    http://www.screencast.com/t/QDz9GIzTxtBh


    #2
    If this is an attempt to report a framework issue, you need to provide a way to reproduce this rather than just a screenshot of your application not working. But at a guess, you are probably trying to remove the tab, which is in the middle of handling a click event, and that would be invalid and is reported to you in the Developer Console. Instead, call markForDestroy(), and also select some other tab.

    Comment


      #3
      antonychristopher I think you're experiencing a peculiarity with how the removeTab function works. In the docs it says:
      RemoveTab : The pane associated with the removed tab is automatically destroyed when you call this method. To avoid this, call com.smartgwt.client.widgets.tab.TabSet.updateTab with null as the new pane immediately before removing the tab


      This should work: tabSet.setDestroyPanes(false);

      Or I think something like this should work :
      comboBoxItem.addChangedHandler(new ChangedHandler() {
      @Override
      public void onChanged(ChangedEvent event) {
      if (Arrays.asList(tabSet.getTabs()).contains(customTab)) {
      tabSet.updateTab(customTab, null);
      tabSet.removeTab(customTab);
      } else {
      customTab.setPane(getTabPane());
      tabSet.addTab(customTab);
      }
      }

      });
      Last edited by Stefanie; 1 Apr 2018, 06:00.

      Comment

      Working...
      X