Monday, September 20, 2010

Grid shrink-to-fit

Hi all,

I've been trying to set up a simple panel/grid for a login box. Something like

final Grid mainPanel = new Grid(2, 2);
final Label userNameLabel = new Label("User Name");
mainPanel.setWidget(0, 0, userNameLabel);
final TextBox userNameField = new TextBox();
mainPanel.setWidget(0, 1, userNameField);
final Label passwordLabel = new Label("Password");
mainPanel.setWidget(1, 0, passwordLabel);
final PasswordTextBox passwordField = new PasswordTextBox();
mainPanel.setWidget(1, 1, passwordField);
initWidget(mainPanel);

Each row has a height of 50% of the screen. How do I get mainPanel to
shrink-to-fit?

(I assume that the reason for the 50% row height is that the generated
table (and all the surrounding divs) is (are) styled "position:
absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;". So
presumably another way of getting the desired result is clearing this
style. I tried mainPanel.getElement().setAttribute("style", "") but
that doesn't not seem to have the slightest effect.)

Any ideas?

Cheers,
Hilco

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate