posta07
24 Jul 2008, 1:56 PM
When I add a form to a tab panel, and then the tab panel to the window, the form elements do not render properly, specifically, the elements get shifted up into the tabs.
Once compiled, everything renders properly in FF3. However, in the GWT hosted mode and in IE 6 the error presents itself. Using latest from the Trunk, and GWT 1.5.0
See code for demo:
public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FlowLayout());
final Window popup = new Window();
popup.setLayout(new FlowLayout());
popup.setWidth(500);
Button button = new Button("Samples");
button.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
popup.show();
}
});
TabPanel tabs = new TabPanel();
TabItem tab1 = new TabItem();
tab1.setText("Tab 1");
tab1.setLayout(new FormLayout());
TabItem tab2 = new TabItem();
tab2.setText("Tab 2");
tab2.setLayout(new FormLayout());
TextField<String> name = new TextField<String>();
name.setFieldLabel("Name");
name.setValue("Christian");
tab1.add(name, new FormData());
tabs.add(tab1);
tabs.add(tab2);
popup.add(tabs);
Html moreDetail;
moreDetail = new Html("<span class='x-nodrag' style='text-decoration: underline; cursor: pointer'>more detail</span> ");
popup.getHeader().insertTool(moreDetail, 0);
moreDetail.sinkEvents(Events.OnClick);
moreDetail.addListener(Events.OnClick, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
DeferredCommand.addCommand(new Command() {
public void execute() {
MessageBox.alert("Click", "You clicked it!", null);
}
});
}
});
viewport.add(moreDetail);
RootPanel.get().add(button); }
Once compiled, everything renders properly in FF3. However, in the GWT hosted mode and in IE 6 the error presents itself. Using latest from the Trunk, and GWT 1.5.0
See code for demo:
public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FlowLayout());
final Window popup = new Window();
popup.setLayout(new FlowLayout());
popup.setWidth(500);
Button button = new Button("Samples");
button.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
popup.show();
}
});
TabPanel tabs = new TabPanel();
TabItem tab1 = new TabItem();
tab1.setText("Tab 1");
tab1.setLayout(new FormLayout());
TabItem tab2 = new TabItem();
tab2.setText("Tab 2");
tab2.setLayout(new FormLayout());
TextField<String> name = new TextField<String>();
name.setFieldLabel("Name");
name.setValue("Christian");
tab1.add(name, new FormData());
tabs.add(tab1);
tabs.add(tab2);
popup.add(tabs);
Html moreDetail;
moreDetail = new Html("<span class='x-nodrag' style='text-decoration: underline; cursor: pointer'>more detail</span> ");
popup.getHeader().insertTool(moreDetail, 0);
moreDetail.sinkEvents(Events.OnClick);
moreDetail.addListener(Events.OnClick, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
DeferredCommand.addCommand(new Command() {
public void execute() {
MessageBox.alert("Click", "You clicked it!", null);
}
});
}
});
viewport.add(moreDetail);
RootPanel.get().add(button); }