Question about Dynamic Forms in GWT.

201 views
Skip to first unread message

pimuri

unread,
Feb 27, 2012, 5:00:34 AM2/27/12
to Google Web Toolkit
Hi All,

I'm new to using GWT (Version 2.4 with Eclipse).

I have a question about dynamic forms.

For a web application I would like to make a dynamic form with two
columns of comboboxes. At the beginning only one combobox (cb1_1) on
the left column exists. As soon as a value has been chosen from this
first combobox, a new combobox will be created in the the right column
(cb1_2). When a value is chosen in that combobox a new line will be
started (again first only the left column combobox, etc). The right
column combobox is always dependant on the chosen value in the right
column combobox.



Following a bad timeline sketch of the two columns:

- = new combobox (no value chosen yet)
O = combobox where user has chosen a value

1)
- row 1

2)
O- row 1

3)
OO row 1
- row 2

4)
OO row 1
O- row 2

5)
OO row 1
OO row 2
- row 3

etc


My questions to you....

- How would you implement this? Would you first define a limit of rows
and prepare the comboboxes in the background, hide them and disable
them until needed or would you create them dynamically?

- How would you create a common handler for either all of the
comboboxes or at least for each column?


Thank you for any help/comments.

pimuri

Thad

unread,
Mar 2, 2012, 3:57:19 PM3/2/12
to google-we...@googlegroups.com
I think I'd create them dynamically as needed, maybe laying them out in a FlexTable so I could add rows as I need them.

I'd keep the combo boxes in an array list. When the form was submitted, I'd read through the array list, capture the values into some structure, and send that structure in my RPC method call. If the values were submitted in a FormPanel, I'd put the values into a JSON list and assign a Hidden field the string value.
Reply all
Reply to author
Forward
0 new messages