Hello,
I don't know if this is a bug or if I miss something...
When I try using the TabPanel, with the same code as the Explorer Demo, I have the following error:
In debug mode, I see that TabItemConfig as a null "text" field.Code:
java.lang.NullPointerException: null
at com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(SafeHtmlUtils.java:156)
at com.sencha.gxt.theme.base.client.tabs.TabPanelBaseAppearance_ItemTemplate_render_SafeHtml__TabPanelBaseStyle_style__TabItemConfig_config___SafeHtmlTemplatesImpl.render0(TabPanelBaseAppearance_ItemTemplate_render_SafeHtml__TabPanelBaseStyle_style__TabItemConfig_config___SafeHtmlTemplatesImpl.java:18)
at com.sencha.gxt.theme.base.client.tabs.TabPanelBaseAppearance_ItemTemplateImpl.render(TabPanelBaseAppearance_ItemTemplateImpl.java:30)
at com.sencha.gxt.theme.base.client.tabs.TabPanelBaseAppearance.insert(TabPanelBaseAppearance.java:218)
at com.sencha.gxt.widget.core.client.TabPanel.insert(TabPanel.java:368)
at com.sencha.gxt.widget.core.client.TabPanel.add(TabPanel.java:203)
at test.tabtest.client.TabTestUi_MyUiBinderImpl.createAndBindUi(TabTestUi_MyUiBinderImpl.java:32)
at test.tabtest.client.TabTestUi_MyUiBinderImpl.createAndBindUi(TabTestUi_MyUiBinderImpl.java:1)
at test.tabtest.client.TabTestUi.asWidget(TabTestUi.java:28)
at test.tabtest.client.TabTestUi.onModuleLoad(TabTestUi.java:32)
This is the code:
andCode:package test.tabtest.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.widget.core.client.TabItemConfig;
import com.sencha.gxt.widget.core.client.TabPanel;
import com.sencha.gxt.widget.core.client.info.Info;
public class TabTestUi extends Composite implements IsWidget, EntryPoint {
interface MyUiBinder extends UiBinder<Widget, TabTestUi> {
}
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
@UiField(provided = true)
String txt = "Bla bla bla bla bla";
public Widget asWidget() {
return uiBinder.createAndBindUi(this);
}
public void onModuleLoad() {
RootPanel.get().add(asWidget());
}
@UiHandler(value = {"folder", "panel"})
void onSelection(SelectionEvent<Widget> event) {
TabPanel panel = (TabPanel) event.getSource();
Widget w = event.getSelectedItem();
TabItemConfig config = panel.getConfig(w);
Info.display("Message", "'" + config.getText() + "' Selected");
}
}
Thanks.Code:<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:tabs="urn:import:com.sencha.gxt.widget.core.client"
xmlns:container="urn:import:com.sencha.gxt.widget.core.client.container">
<ui:with type="java.lang.String" field="txt" />
<ui:with type="com.sencha.gxt.widget.core.client.TabItemConfig"
field="shortTextTabConfig">
<ui:attributes text="Short Text" />
</ui:with>
<ui:with type="com.sencha.gxt.widget.core.client.TabItemConfig"
field="longTextTabConfig">
<ui:attributes text="Long Text" />
</ui:with>
<ui:with type="com.sencha.gxt.widget.core.client.TabItemConfig"
field="normalTabConfig">
<ui:attributes text="Normal" />
</ui:with>
<ui:with type="com.sencha.gxt.widget.core.client.TabItemConfig"
field="disabledTabConfig">
<ui:attributes text="Disabled" enabled="false" />
</ui:with>
<ui:style>
.sep {
margin-top: 20px;
}
</ui:style>
<container:FlowLayoutContainer>
<tabs:TabPanel ui:field="folder" width="450"
addStyleNames="margin-10">
<tabs:child config="{shortTextTabConfig}">
<g:Label addStyleNames="pad-text" text="{txt}" />
</tabs:child>
<tabs:child config="{longTextTabConfig}">
<container:FlowLayoutContainer>
<g:Label text="{txt}" addStyleNames="pad-text" />
<g:Label text="{txt}" addStyleNames="pad-text {style.sep}" />
</container:FlowLayoutContainer>
</tabs:child>
</tabs:TabPanel>
<tabs:TabPanel ui:field="panel" plain="true" pixelSize="450, 250"
addStyleNames="margin-10">
<tabs:child config="{normalTabConfig}">
<g:Label text="Just a plain old tab" addStyleNames="pad-text" />
</tabs:child>
<tabs:child config="{disabledTabConfig}">
<g:Label text="This tab should be disabled" addStyleNames="pad-text" />
</tabs:child>
</tabs:TabPanel>
</container:FlowLayoutContainer>
</ui:UiBinder>

