SetCellWidth using * (Asterisk)

27 views
Skip to first unread message

Dave

unread,
Jan 29, 2007, 4:26:48 PM1/29/07
to Google Web Toolkit
I've had no luck using SetCellWidth(myWidget, "*").

I saw this post: http://groups.google.com/group/Google-Web-Toolkit/msg/
94a312d5a5624683

and I can verify it's happening with the latest GWT (1.3 RC2). It
won't even show up in hosted mode and gives me an exception:

[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: JavaScript Error
exception: Invalid argument.
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.
java:435)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeVoid(ModuleSpace
IE6.java:320)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost
.java:141)
at com.google.gwt.user.client.impl.DOMImpl.setAttribute(DOMImpl.java:
289)
at com.google.gwt.user.client.DOM.setAttribute(DOM.java:782)
at
com.google.gwt.user.client.ui.CellPanel.setCellWidth(CellPanel.java:
110)

I've got a HorizontalPanel that I add two labels to, then try to set
the width of the second one to "*" and it fails.

Is it broken or am I doing it incorrectly?

Pavel

unread,
Jan 29, 2007, 4:32:52 PM1/29/07
to Google-We...@googlegroups.com
If by "*" you mean:
1. 100% -- then try setCellWidth(myWidget, "100%").
2. remaining space -- then do nothing, it will automatically occupy
remaining space.

Hope this helps.

Pavel

Dave

unread,
Jan 29, 2007, 4:39:00 PM1/29/07
to Google Web Toolkit
> If by "*" you mean:
> 1. 100% -- then try setCellWidth(myWidget, "100%").
> 2. remaining space -- then do nothing, it will automatically occupy
> remaining space.

By "*" I mean: fill the remaining space.

And it looks like you are correct :)

I had two columns and I wanted the first one to only be as wide as the
text in it. So I set it's width to 2px and styled it to not wrap
whitespace. Then, I got ahead of myself and was trying to set the
width of col2 to "*" when I didn't need to.

Thanks!

-D

Reply all
Reply to author
Forward
0 new messages