PDA

View Full Version : on module load



geovannefarell
21 Jan 2012, 11:08 PM
hy,
now i want to create some web application with GXT,
i want the first look some button, if button click then show border layout,
but i cant do it,
it some script in module load :


public void onModuleLoad() {

RootPanel rp=RootPanel.get("main");

Viewport vp=new Viewport();
rp.add(vp);

Dispatcher d=Dispatcher.get();
MainController mc=new MainController();
d.addController(mc);


vp.setLayout(new BorderLayout());

BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH);
ContainerData ac=new ContainerData(vp, northData);
Dispatcher.get().dispatch(atasEvent.DISPLAY, ac);
northData.setSize(150);
northData.setMargins(new Margins(0, 0, 5, 0));
vp.layout(true);


BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST);
ContainerData dc=new ContainerData(vp, westData);
westData.setSplit(true);
westData.setSize(200);
westData.setMaxSize(400);
westData.setCollapsible(true);
Dispatcher.get().dispatch(treeEvent.DISPLAY, dc);

BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
ContainerData cd=new ContainerData(vp, centerData);
Dispatcher.get().dispatch(menuEvent.DISPLAY, cd);
vp.layout(true);

}

i want some window show first, and if button click in window, then show like this
30886

now i can show that first.
can somebody help me please....

Ersmarker
1 Feb 2012, 2:55 AM
Move you code in onModuleLoad to a seperate method (start() in my example)
In onModuleLoad create a window with a button that lunches your app.



public void onModuleLoad() {
final Window w = new Window();
Button b = new Button("Start!!!", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
w.hide();
start();
}
});
w.add(b);
w.show();
}

geovannefarell
4 Mar 2012, 12:15 AM
it works...!!
thanks =D>