java - GWT: How can I reinitialize a widget in UI binder discarding all changes obtained during its life cycle? -


I have a UI-binder-powered composite that contains a lot of widgets and is used for item-specific information. Suppose, this is just a composite:

  ...  & Lt; G: label ui: field = "description" /> & Lt; W: CustomPanel & gt; & Lt; W: customfu you: field = "afu" & gt; ... & lt; / w: customfu & gt; & Lt; W: Custom UI UI: Field = "Bar" & gt; ... & lt; / W: custombar & gt; & Lt; / W: CustomPanel & gt; & Lt; / H: FlowPanel & gt; & Lt; g: FlowPanel UI: field = "itemPanel2" & gt; ... & lt; / g: FlopNell & gt; ...   

At some point, I have to hide the first panel using the hide () method. However, the hide () method can not be sufficient if restart () itemPanel panel, and possibly intended for free DOM resources Which can be allocated for CustomFoo and CustomBar components, please note that itemPanel.clear (); Destroys all nested widgets, so a consistent call such as title.setText (...) has no effect because DOM has been deleted in this scenario.

How can I redesign itempanel , like it has been loaded with its UI binder?

Thanks in advance.

ItemPanel to create a widget then you can use:

  MyCompositeWidget.remove (panel1); ItemsPanel panel2 = new itemPanel (); MyCompositeWidget.add (panel2);   

If you need a specific situation, you can use insert () rather than add ().

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -