fother
22 Jan 2009, 3:52 AM
public void onModuleLoad() {
final TextField<String> text1 = new TextField<String>();
TextField<String> text2 = new TextField<String>();
final LayoutContainer container = new LayoutContainer(new FormLayout());
container.add(text1);
container.hide();
LayoutContainer container2 = new LayoutContainer(new FormLayout());
container2.add(text2);
Button x = new Button("xx");
x.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
System.out.println(container.isVisible());
System.out.println(text1.isVisible());
}
});
LayoutContainer main = new LayoutContainer();
main.add(container);
main.add(container2);
main.add(x);
RootPanel.get().add(main);
}
when the method hide() is called, the attribute visible of the container received false, ok, but the other components that was added in the container, not received false..
final TextField<String> text1 = new TextField<String>();
TextField<String> text2 = new TextField<String>();
final LayoutContainer container = new LayoutContainer(new FormLayout());
container.add(text1);
container.hide();
LayoutContainer container2 = new LayoutContainer(new FormLayout());
container2.add(text2);
Button x = new Button("xx");
x.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
System.out.println(container.isVisible());
System.out.println(text1.isVisible());
}
});
LayoutContainer main = new LayoutContainer();
main.add(container);
main.add(container2);
main.add(x);
RootPanel.get().add(main);
}
when the method hide() is called, the attribute visible of the container received false, ok, but the other components that was added in the container, not received false..