GWT simple error???

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

GWT simple error???

Postby brw2008 » Sun Apr 13, 2008 4:58 am

on another topic now, i have gone past this and i have decided to try some example code i have found to try and code a little shop....althought everything has compiled correctly apart from the main java class file....and for some reason it cannot find a private method that is in the same class?? i have no idea why, does anyone know why this cannot find this??

the code i have acheived is below: -

Code: Select all
public class FruitMart implements EntryPoint {

  public void onModuleLoad() {

    VerticalPanel mainPanel = new VerticalPanel();
    mainPanel.setWidth("100%");
    mainPanel.setHeight("100%");

    //the top panel displaying the FruitMart title
    HorizontalPanel topPanel = new HorizontalPanel();
    topPanel.setWidth("100%");
    topPanel.setHeight("100%");
    topPanel.setStyleName("topPanel");

    Label fruitMartLabel = new Label("FruitMart");
    fruitMartLabel.setStyleName("mainPanel");
    topPanel.add(fruitMartLabel);


    //the panel where the fruit stands and fruit basket are displayed
    HorizontalPanel fruitMartPanel = new HorizontalPanel();
    fruitMartPanel.setWidth("100%");
    fruitMartPanel.setHeight("100%");

    //the tab panel with all the different sections
    TabPanel fruitStandsPanel = new TabPanel();
    fruitStandsPanel.setHeight("100%");
    fruitStandsPanel.setWidth("75%");
    I<attachFruitStandsTabs(fruitStandsPanel);> ---THIS DOESNT WORK
    I<fruitStandsPanel.selectTab(0);>                ---THIS DOESNT WORK
    fruitStandsPanel.selectTab(0);
    fruitMartPanel.add(fruitStandsPanel);
    fruitMartPanel.setCellHeight(fruitStandsPanel, "100%");
    fruitMartPanel.setCellWidth(fruitStandsPanel, "75%");

    //the basket panel
    VerticalPanel fruitBasketPanel = new VerticalPanel();
    fruitBasketPanel.setHeight("100%");
    fruitBasketPanel.setWidth("25em");
    Label fruitBasketLabel = new Label("Fruit Basket");
    fruitBasketLabel.addStyleName("fruitBasketLabel");
    fruitBasketPanel.add(fruitBasketLabel);
    I<attachFruitBasketItems(fruitBasketPanel);>          ---THIS DOESNT WORK
    Button fruitBasketConfirmButton = new Button();
    fruitBasketConfirmButton.setText("Confirm");
    fruitBasketPanel.add(fruitBasketConfirmButton);
    fruitMartPanel.add(fruitBasketPanel);
    fruitMartPanel.setCellHeight(fruitBasketPanel, "100%");
    fruitMartPanel.setCellWidth(fruitBasketPanel, "25%");

    mainPanel.add(topPanel);
    mainPanel.add(fruitMartPanel);
    mainPanel.setCellHeight(topPanel, "10%");
    mainPanel.setCellHeight(fruitMartPanel, "90%");

    RootPanel.get().add(mainPanel);

  }

  private void attachFruitBasketItems(VerticalPanel fruitBasketPanel) {

    //CODE IS HERE, COMPILES CORRECTLY AND SHOULD WORK FINE

  }

  private void attachFruitStandsTabs(TabPanel fruitStandsTabPanel) {

  //AGAIN CODE IS HERE, COMPILES CORRECTLY AND SHOULD WORK FINE
 
  }

I just cannot understand why the onLoadMethod cannot see the correct methods that i have defined in the same class?? what am i doing wrong??


Many Thanks
brw2008
 
Posts: 6
Joined: Wed Apr 09, 2008 6:22 am

Re: GWT simple error???

Postby Eric Clayberg » Sun Apr 13, 2008 5:22 am

The only problem I see with your example is that it is syntactically incorrect Java code.

Fix the syntax problems with the lines you identified and it should compile fine.

Once again, I must reiterate that this forum is for GWT Designer questions. General GWT questions should be directed to Google's GWT forum.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: GWT simple error???

Postby brw2008 » Sun Apr 13, 2008 5:42 am

oh sorry, i just started a new question in the same thing, i shall change next time thank you for pointing this out! You said that the java for is syntatically incorrect, how do you go about using the iterator with GWT?? How would you write that line of code??

regards
brw2008
 
Posts: 6
Joined: Wed Apr 09, 2008 6:22 am

Re: GWT simple error???

Postby Eric Clayberg » Sun Apr 13, 2008 5:57 am

All three lines of code that you marked with "THIS DOESNT WORK" are syntactically incorrect as pointed out by the Eclipse compiler.

For example, the line...

Code: Select all
I<attachFruitStandsTabs(fruitStandsPanel);>

...should just be...

Code: Select all
attachFruitStandsTabs(fruitStandsPanel);

I'm sorry, but this forum is really not the place for simple Java or simple GWT questions.

We are more than happy to address any GWT Designer specific issues that you have. All other questions should be directed elsewhere.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests