hi,

I'm siva. A beginner to GWT and UI development.Please help in the
following scenario...

I'm having navigation panel and a main panel (both are ContentPanels).
I've few images in the navigation panel.
when i'm clicking one among them i want to change the center panel
contents. For eg. when I'm clicking login image the center panel
should display the login screen. if I click the home image the center
panel has to display the home image.

my main page code is

[CODE]public class OnlineBookStore implements EntryPoint {
        SideBar sideBar = new SideBar();
        CenterPaneIntf centerPane = new HomePage();
        HeaderPane header = new HeaderPane();

        LayoutContainer north = header.paintHeader();
        LayoutContainer center  = centerPane.paintCenterForm();
        LayoutContainer west = sideBar.paintSideBar(this);

        BorderLayout bdrLayout = new BorderLayout();
        LayoutContainer container  = new LayoutContainer(bdrLayout);

        public void onModuleLoad() {

                try {

                        BorderLayoutData northData = new
BorderLayoutData(LayoutRegion.NORTH, 100);
                        northData.setCollapsible(true);
                        northData.setFloatable(true);
                        northData.setHideCollapseTool(true);
                        northData.setSplit(true);
                        northData.setMargins(new Margins(0, 0, 5, 0));

                        BorderLayoutData westData = new 
BorderLayoutData(LayoutRegion.WEST,
250);
                        westData.setSplit(true);
                        westData.setCollapsible(true);
                        westData.setMargins(new Margins(0,5,0,0));

                        BorderLayoutData centerData = new
BorderLayoutData(LayoutRegion.CENTER);
                        centerData.setMargins(new Margins(0));

                        LayoutContainer centerlayoutcontainer = new 
LayoutContainer(new
CenterLayout());
                        centerlayoutcontainer.add(center);

                        container.add(north,northData);
                        container.add(west,westData);
                        container.add(centerlayoutcontainer,centerData);
                        container.setStyleAttribute("padding", "10px");
                        container.setHeight(Window.getClientHeight());
                        container.setWidth("auto");

                        RootPanel.get().add(container);
                } catch (Exception e) {
                        System.out.println("Exception occuered" + e);
                }

        }
}
[/CODE]

the navigation panel code is

[CODE]public class SideBar {

        ContentPanel west = new ContentPanel();
        VBoxLayout westLayout = new VBoxLayout();
        VBoxLayoutData flex = new VBoxLayoutData(new Margins(0, 0, 5, 0));
        VBoxLayoutData flex1 = new VBoxLayoutData(new Margins(0, 0, 5, 0));
        OnlineBookStore parent = null;

        final Image homeImg = new Image("/images/icons/Black_Blue_png/
AddressBook/48.png",0, 0, 50, 50);
        final Image aboutUsImg= new Image("/images/icons/Black_Blue_png/
TextEdit/48.png",0, 0, 50, 50);
        final Image contactUsImg= new Image("/images/icons/Black_Blue_png/
iChat/48.png",0, 0, 50, 50);
        Image signInImg= new Image("/images/icons/signin.png", 0, 0, 50, 50);

        void paintMain(CenterPaneIntf login){
                parent.center = login.paintCenterForm();
                parent.center.setLayoutOnChange(true);
                parent.center.layout();
                System.out.println(parent.center.getTitle());
        }

        public LayoutContainer paintSideBar(OnlineBookStore book) {
                westLayout.setPadding(new Padding(10));
                westLayout.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
                flex.setFlex(1);
                parent = book;
                west.setFrame(true);
                flex1.setFlex(1);
                west.setLayout(westLayout);
                west.add(homeImg, flex1);
                west.add(new Label(), flex);
                west.add(aboutUsImg, flex1);
                west.add(new Label(), flex);
                west.add(contactUsImg, flex1);
                west.add(new Label(), flex);
                west.add(signInImg, flex1);
                homeImg.setTitle("Home");

                homeImg.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                                paintMain(new LoginForm());
                        }
                });
                return west;
}
[/CODE]

Above code is not at all working...
Really struggling to implement the same. Any help is highly
appreciated...
Thanks in advance.:)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to