NPE

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

NPE

Postby ashouric » Wed Jan 10, 2007 9:26 am

Dear All,

Have a look at the following case:

Code: Select all
public class MyComposite extends Composite {

   public MyComposite() {
      final FlexTable flexTable = new FlexTable();
      initWidget(flexTable);

      final Label titleLabel = new Label("hello");
      flexTable.setWidget(0, 0, titleLabel);
      flexTable.getFlexCellFormatter().setColSpan(0, 0, 2);

      final Label label = new Label(" ");
      flexTable.setWidget(1, 0, label);
      label.setWidth("30");

      final HTML textLabel = new HTML("hello there");
      flexTable.setWidget(1, 0, textLabel);
      flexTable.getFlexCellFormatter().setColSpan(1, 0, 2);
      flexTable.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);

      final Image image = new Image();
      flexTable.setWidget(1, 3, image);
      image.setUrl("some.png");

      setWidth("778");
   }

}


I guess having two widget in same cell is invalid, but it is accepted by GWT.
ashouric
 
Posts: 75
Joined: Sat Sep 30, 2006 9:13 pm

Re: NPE

Postby Eric Clayberg » Wed Jan 10, 2007 12:02 pm

ashouric wrote:I guess having two widget in same cell is invalid, but it is accepted by GWT.

Having two widgets in the same cell isn't valid. GWT doesn't really accept it...it simply ignores it by using the most recently defined widget in that cell.

In our latest build, we now do the same thing.
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