Hi
I have been implementing the input form like the following code:
Label nameLabel = new Label("Name");
TextBox nameTextBox = new TextBox();
Label ageLabel = new Label("Age");
TextBox ageTextBox = new TextBox();
// we have two labels and two fields, so 2x2
Grid grid = new Grid(2, 2);
grid.setWidget(0, 0, nameLabel);
grid.setWidget(0, 1, nameTextBox );
grid.setWidget(1, 0, ageLabel);
grid.setWidget(1, 1, ageTextBox);
// set the style to every cell
CellFormatter fmt = grid.getCellFormatter();
fmt.setStyleName(0, 0, "labelStyle");
fmt.setStyleName(0, 1, "inputStyle");
fmt.setStyleName(1, 0, "labelStyle");
fmt.setStyleName(1, 1, "inputStyle");
I'm using Grid because I want the labels and fields to be aligned.
The code becomes ugly when there are 10 or more fields!
Can you share your experience in aligning the labels and fields (form) in
plain GWT?
--
Hez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---