Force attach of a tab item
I have a TabPanel which has multiple items. On every TabItem there are some fields. I have written a FormButtonBinding class, which monitors all the TabItems (which contain FormPanels). The monitoring class uses FormPanel.isValid() which calls on every field Field.isValid(). Here is a call of Field.getRawValue() which will only work if the field has been rendered. How I can force an attach/rendering for the hidden panels?
Hm, it seems to be trivial.
I have looked into the GXT code to find out more about the rendering/attaching process. The TabPanel has a CardLayout, which renders the child widgets when the parent panel (Window) has been added to the RootPanel. But the renderComponent() method renders only the active widget (the active TabItem) of the TabPanel or all items, if the flag deferredRender is set to false. The CardLayout sets this flag to true, so the render process stops after the selected TabItem.
In a sub-class of TabPanel I have set the flag to false, so all TabItems are rendered and attached to the DOM and my monitoring class can validate all fields of the hidden TabItems.
Tags for this Thread