6

I want to use a SmartGWT Layout in Vaadin 7. I searched it everywhere; But, couldn't get the correct tutorial or any source code. Can anyone help me in this?

And, I tried in SmartGWT. I created a Layout in SmartGWT.

public class SmartGWTLayout extends Widget {
   public SmartGWTLayout() {
    TabSet tabSet = new TabSet();
    tabSet.setTabBarPosition(Side.TOP);
    tabSet.setWidth(400);
    tabSet.setHeight(200);

    Tab tTab1 = new Tab("Blue", "pieces/16/pawn_blue.png");
    Img tImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
    tTab1.setPane(tImg1);

    Tab tTab2 = new Tab("Green", "pieces/16/pawn_green.png");
    Img tImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
    tTab2.setPane(tImg2);

    tabSet.addTab(tTab1);
    tabSet.addTab(tTab2);

    VLayout vLayout = new VLayout();
    vLayout.setMembersMargin(15);
    vLayout.addMember(tabSet);
    vLayout.setAutoHeight();

    vLayout.draw();
  }
}

I called the Layout in Vaadin like this.

            SmartGWTLayout aSmartGWTLayout = new SmartGWTLayout();
            vaadinLayout.addComponent((Component)SmartGWTLayout);

And, I'm getting this error

  HTTP Status 500 - java.lang.NoClassDefFoundError: com/google/gwt/core/shared/GWTBridge

  type: Exception report

  message: java.lang.NoClassDefFoundError: com/google/gwt/core/shared/GWTBridge

  description: The server encountered an internal error that prevented it from fulfilling this request.
PhiLho
  • 40,535
  • 6
  • 96
  • 134
Gugan
  • 1,625
  • 2
  • 27
  • 65
  • Some one please answer this.! – Gugan Feb 26 '13 at 07:15
  • 1
    That's SmartGWT layout, because a "smart GWT layout" means something else for me (opposite of "dumb GWT layout!). I edited the question to fix that. – PhiLho Apr 24 '13 at 16:21

1 Answers1

1

This is not the right way to use GWT Widget in Vaadin.

Try to follow this tutorial:

http://java.dzone.com/articles/using-gwt-widgets-vaadin-7

http://java.dzone.com/articles/using-gwt-widgets-vaadin-7-0

http://java.dzone.com/articles/using-gwt-widgets-vaadin-7-1

If you use the Vaadin Plugin for Eclipse: https://vaadin.com/eclipse

You can create a new Widget with all the features (necessary classes, xml files and widgetset) at:

Project/New/Other/Vaadin/Widget

RAN
  • 508
  • 6
  • 18
  • Oops.. It seems to be tough to add a smart GWT widget.. Did u try that? worked for u? – Gugan Feb 27 '13 at 12:35
  • i am working on it... but it does not seem that complicated. the tutorial is very helpful in this situation ;). are you using the vaadin plugin for eclipse? than you can easily create a gwt widget with a small example....very helpful for understanding ^^ – RAN Feb 27 '13 at 12:56
  • Yes. I'm using vaadin plugin for eclipse. – Gugan Feb 27 '13 at 14:59