ggeorg / gwt-mosaic

Automatically exported from code.google.com/p/gwt-mosaic
1 stars 0 forks source link

Unable to get index position of tabs in TabLayoutPanel #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

HTML testWidget = new HTML("Foo");
tabPanelLayout.add(testWidget, "Foo");

tabPanelLayout.getWidgetIndex(testWidget); 

What is the expected output? What do you see instead?

Should return index position of the referenced widget.   Instead, always 
returns -1.

What version of the product are you using? On what operating system?

SVN TRUNK

Please provide any additional information below.

Original issue reported on code.google.com by bro...@gmail.com on 13 Jan 2009 at 11:57

GoogleCodeExporter commented 9 years ago
Upon reading the source code, it's clear why this doesn't work: 

  public void add(Widget w, String tabText, boolean asHTML) {
    assert (w != null);

    tabBar.addTab(tabText, asHTML);

    final LayoutPanel panel = new LayoutPanel();
    panel.add(w);

    deck.add(panel);
  }

...

Since you wrap the widget in a LayoutPanel, it makes it impossible to reference 
the index position with the 
original widget.

Original comment by bro...@gmail.com on 13 Jan 2009 at 11:59

GoogleCodeExporter commented 9 years ago
Hi,

that issue is fixed.

http://code.google.com/p/gwt-mosaic/source/detail?r=519

Thanks,
George.

Original comment by georgopo...@gmail.com on 14 Jan 2009 at 1:33