Re: There is a bug in CellPanel.java

2008-12-11 Thread wurenhai

I agree that I must add 'b' to a cell before a set the size.

But my problem is that, it doesn't report error in host model, while
it reports error in IE.

I use gwt 1.5.3.


On 12月9日, 上午2时04分, Ian Bambury ianbamb...@gmail.com wrote:
 You can't set the size of the cell that 'b' is in before you add 'b' to a
 cell.



 v.setCellWidth(b, 100px);

v.add(b);

 Ian

 http://examples.roughian.com

 2008/12/8 wurenhai wuren...@gmail.com





  Let's read the following code:
  ==CellPanel.java===
   /**
* Sets the height of the cell associated with the given widget,
  related to
* the panel as a whole.
*
* @param w the widget whose cell height is to be set
* @param height the cell's height, in CSS units
*/
   public void setCellHeight(Widget w, String height) {
 Element td = DOM.getParent(w.getElement());
 DOM.setElementProperty(td, height, height);
   }

   /**
* Sets the horizontal alignment of the given widget within its
  cell.
*
* @param w the widget whose horizontal alignment is to be set
* @param align the widget's horizontal alignment, as defined in
*  {...@link HasHorizontalAlignment}.
*/
   public void setCellHorizontalAlignment(Widget w,
   HorizontalAlignmentConstant align) {
 Element td = getWidgetTd(w);
 if (td != null) {
   setCellHorizontalAlignment(td, align);
 }
   }

   /**
* Sets the vertical alignment of the given widget within its cell.
*
* @param w the widget whose vertical alignment is to be set
* @param align the widget's vertical alignment, as defined in
*  {...@link HasVerticalAlignment}.
*/
   public void setCellVerticalAlignment(Widget w,
  VerticalAlignmentConstant align) {
 Element td = getWidgetTd(w);
 if (td != null) {
   setCellVerticalAlignment(td, align);
 }
   }

   /**
* Sets the width of the cell associated with the given widget,
  related to the
* panel as a whole.
*
* @param w the widget whose cell width is to be set
* @param width the cell's width, in CSS units
*/
   public void setCellWidth(Widget w, String width) {
 Element td = DOM.getParent(w.getElement());
 DOM.setElementProperty(td, width, width);
   }

  
  The method setCellSize is defferent from setCellAlign.
  I want to say that, there is a bug use setCellSize:
 VerticalPanel v = new VerticalPanel();
 Button b = new Button(Button);
 v.setCellWidth(b, 100px);
 v.add(b);
  These codes are normal when i uesed in debug model, but there is a IE
  error after i comlie it. The td is null!- 隐藏被引用文字 -

 - 显示引用的文字 -
--~--~-~--~~~---~--~~
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-Toolkit@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
-~--~~~~--~~--~--~---



Re: There is a bug in CellPanel.java

2008-12-08 Thread David H. Cook

I'm just guessing and shooting from the hip, but
your problem is probably not a bug.

I've only been coding GWT for about a week now, but
have found that I must really read the docs carefully
and think globally, when it comes to stuff relating to
'styles' and stuff that is also controlled by .CSS files, etc.

As just one example, I spent a few HOURS debugging/fixing
a problem trying to reduce cell-size of something I was
adding to a VerticalPanel, and nothing would work.
Final fix was that it finally dawned on me, that most
all the 'panel' widgets in GWT are implemented with
table elements, and the fix was to tweak the styles
that I had for table-elements in my projects .CSS file.

Hope this helps your thinking...sorry that I don't have
a more specific answer.

On Dec 7, 9:55 pm, wurenhai [EMAIL PROTECTED] wrote:
 Let's read the following code:
 ==CellPanel.java===
   /**
    * Sets the height of the cell associated with the given widget,
 related to
    * the panel as a whole.
    *
    * @param w the widget whose cell height is to be set
    * @param height the cell's height, in CSS units
    */
   public void setCellHeight(Widget w, String height) {
     Element td = DOM.getParent(w.getElement());
     DOM.setElementProperty(td, height, height);
   }

   /**
    * Sets the horizontal alignment of the given widget within its
 cell.
    *
    * @param w the widget whose horizontal alignment is to be set
    * @param align the widget's horizontal alignment, as defined in
    *         [EMAIL PROTECTED] HasHorizontalAlignment}.
    */
   public void setCellHorizontalAlignment(Widget w,
       HorizontalAlignmentConstant align) {
     Element td = getWidgetTd(w);
     if (td != null) {
       setCellHorizontalAlignment(td, align);
     }
   }

   /**
    * Sets the vertical alignment of the given widget within its cell.
    *
    * @param w the widget whose vertical alignment is to be set
    * @param align the widget's vertical alignment, as defined in
    *         [EMAIL PROTECTED] HasVerticalAlignment}.
    */
   public void setCellVerticalAlignment(Widget w,
 VerticalAlignmentConstant align) {
     Element td = getWidgetTd(w);
     if (td != null) {
       setCellVerticalAlignment(td, align);
     }
   }

   /**
    * Sets the width of the cell associated with the given widget,
 related to the
    * panel as a whole.
    *
    * @param w the widget whose cell width is to be set
    * @param width the cell's width, in CSS units
    */
   public void setCellWidth(Widget w, String width) {
     Element td = DOM.getParent(w.getElement());
     DOM.setElementProperty(td, width, width);
   }

 
 The method setCellSize is defferent from setCellAlign.
 I want to say that, there is a bug use setCellSize:
     VerticalPanel v = new VerticalPanel();
     Button b = new Button(Button);
     v.setCellWidth(b, 100px);
     v.add(b);
 These codes are normal when i uesed in debug model, but there is a IE
 error after i comlie it. The td is null!
--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: There is a bug in CellPanel.java

2008-12-08 Thread Ian Bambury
You can't set the size of the cell that 'b' is in before you add 'b' to a
cell.

v.setCellWidth(b, 100px);

   v.add(b);


Ian

http://examples.roughian.com


2008/12/8 wurenhai [EMAIL PROTECTED]


 Let's read the following code:
 ==CellPanel.java===
  /**
   * Sets the height of the cell associated with the given widget,
 related to
   * the panel as a whole.
   *
   * @param w the widget whose cell height is to be set
   * @param height the cell's height, in CSS units
   */
  public void setCellHeight(Widget w, String height) {
Element td = DOM.getParent(w.getElement());
DOM.setElementProperty(td, height, height);
  }

  /**
   * Sets the horizontal alignment of the given widget within its
 cell.
   *
   * @param w the widget whose horizontal alignment is to be set
   * @param align the widget's horizontal alignment, as defined in
   *  [EMAIL PROTECTED] HasHorizontalAlignment}.
   */
  public void setCellHorizontalAlignment(Widget w,
  HorizontalAlignmentConstant align) {
Element td = getWidgetTd(w);
if (td != null) {
  setCellHorizontalAlignment(td, align);
}
  }

  /**
   * Sets the vertical alignment of the given widget within its cell.
   *
   * @param w the widget whose vertical alignment is to be set
   * @param align the widget's vertical alignment, as defined in
   *  [EMAIL PROTECTED] HasVerticalAlignment}.
   */
  public void setCellVerticalAlignment(Widget w,
 VerticalAlignmentConstant align) {
Element td = getWidgetTd(w);
if (td != null) {
  setCellVerticalAlignment(td, align);
}
  }

  /**
   * Sets the width of the cell associated with the given widget,
 related to the
   * panel as a whole.
   *
   * @param w the widget whose cell width is to be set
   * @param width the cell's width, in CSS units
   */
  public void setCellWidth(Widget w, String width) {
Element td = DOM.getParent(w.getElement());
DOM.setElementProperty(td, width, width);
  }

 
 The method setCellSize is defferent from setCellAlign.
 I want to say that, there is a bug use setCellSize:
VerticalPanel v = new VerticalPanel();
Button b = new Button(Button);
v.setCellWidth(b, 100px);
v.add(b);
 These codes are normal when i uesed in debug model, but there is a IE
 error after i comlie it. The td is null!

 


--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



There is a bug in CellPanel.java

2008-12-07 Thread wurenhai

Let's read the following code:
==CellPanel.java===
  /**
   * Sets the height of the cell associated with the given widget,
related to
   * the panel as a whole.
   *
   * @param w the widget whose cell height is to be set
   * @param height the cell's height, in CSS units
   */
  public void setCellHeight(Widget w, String height) {
Element td = DOM.getParent(w.getElement());
DOM.setElementProperty(td, height, height);
  }

  /**
   * Sets the horizontal alignment of the given widget within its
cell.
   *
   * @param w the widget whose horizontal alignment is to be set
   * @param align the widget's horizontal alignment, as defined in
   *  [EMAIL PROTECTED] HasHorizontalAlignment}.
   */
  public void setCellHorizontalAlignment(Widget w,
  HorizontalAlignmentConstant align) {
Element td = getWidgetTd(w);
if (td != null) {
  setCellHorizontalAlignment(td, align);
}
  }

  /**
   * Sets the vertical alignment of the given widget within its cell.
   *
   * @param w the widget whose vertical alignment is to be set
   * @param align the widget's vertical alignment, as defined in
   *  [EMAIL PROTECTED] HasVerticalAlignment}.
   */
  public void setCellVerticalAlignment(Widget w,
VerticalAlignmentConstant align) {
Element td = getWidgetTd(w);
if (td != null) {
  setCellVerticalAlignment(td, align);
}
  }

  /**
   * Sets the width of the cell associated with the given widget,
related to the
   * panel as a whole.
   *
   * @param w the widget whose cell width is to be set
   * @param width the cell's width, in CSS units
   */
  public void setCellWidth(Widget w, String width) {
Element td = DOM.getParent(w.getElement());
DOM.setElementProperty(td, width, width);
  }


The method setCellSize is defferent from setCellAlign.
I want to say that, there is a bug use setCellSize:
VerticalPanel v = new VerticalPanel();
Button b = new Button(Button);
v.setCellWidth(b, 100px);
v.add(b);
These codes are normal when i uesed in debug model, but there is a IE
error after i comlie it. The td is null!

--~--~-~--~~~---~--~~
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-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---