Hi - total noob to GWT/SmartGWT here, so bear with me…How can I get a dynamically generated number of radio buttons, driven by a LinkedHashMap to wrap the radio buttons when the number of radio buttons exceeds the width of the parent form container? Possible?
RadioGroupItem m_datespans_radiogroup = new RadioGroupItem();
m_datespans_radiogroup.setShowTitle(false);
m_datespans_radiogroup.setVertical(false); // lay them out horizontally
/* spanvalues object is a LinkedHashMap<String, String> object
generated by a call to the database */
m_datespans_radiogroup.setValueMap(spanvalues);
m_datespans_radiogroup.setWrap(true); // doesn't work as I hoped
m_datespans_radiogroup.setWidth(300); // thought setting a static width would force a wrap
The code above generates the radio buttons successfully and horizontally, but they go off the page to the right…no matter if I give the width of the DynamicForm they’re added to a static width, a 100% width, nothing. A scrollbar doesn’t even appear so I can’t even scroll over to the right.
The only thing I came up with was to create multiple RadioGroupItems, maxing out at a static number, say 4, and then in the change handler, uncheck any other items selected in any other RadioGroupItem objects on the page…kind of ugly…would be nice if I could get this to be one single RadioGroupItem that wraps vertically as the horizontally laid out radio buittons reaches the width of the parent container.
Environment -
GWT 2.3
SmartGWT 2.4
Java 1.6.017 64bit
Windows 7 Professional 64-bit
IE 9
Thanks for any help in advance…
rob