View Full Version : [FNR] Accordian, FormPanel, ComboBox

20 May 2009, 10:04 PM
Using GWT 1.6.4 and GXT 2.0m2:

When using an Accordian with FormPanel(Layout) children, the ComboBox widget doesn't abide by the width assigned for any subsequent panels.

Browsers Tested:
GWT Window - produces the incorrect width

IE 7 - produces the incorrect width

Safari - renders correctly

FireFox 3 - renders correctly, but the vertical line between the text input and the button does not show.

Additional Notes:

If I create a FormPanel type with a combobox, I can change the order of these panels added to the accordian and always the first one renders the combobox fine, any subsequent (initially hidden) comboboxes render with a longer width.

I've attempted to attach listeners to the accordian control to force laying out/recalculating of the FormPanel to be displayed, but nothing works.

6 Nov 2009, 2:16 PM
What happens is when the components are added to an accordion panel and those panels are initially hidden, then any images referenced for display are not yet 'known' and thus return a width of 0. So the ComboBox sets its input adjusted for the button image which is not yet 'known'.

The solution is to have the ContentPanel loaded into the Accordion override the onExpand() method to only then load the children. You also have to conditionally load those children based on a member variable such that every time expand is called, you're not repeating the form elements over and over.