1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    25
    Vote Rating
    0
    geovannefarell is on a distinguished road

      0  

    Default on module load

    on module load


    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
    Screenshot.jpg

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

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Nov 2010
    Posts
    209
    Vote Rating
    -2
    Ersmarker has a little shameless behaviour in the past

      0  

    Default


    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.

    Code:
        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();
        }

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    25
    Vote Rating
    0
    geovannefarell is on a distinguished road

      0  

    Default


    it works...!!
    thanks

Thread Participants: 1

Tags for this Thread