-
31 May 2010 5:46 AM #1
Dynamic remove of a component in a ContentPanel
Dynamic remove of a component in a ContentPanel
Hi,
I would like to knwo how can I remove a component from a panel:
I try this :
But component in the screen still be visible ....Code:ContentPanel cp = (ContentPanel) this.getWidget(); cp.removeAll(); cp.layout();
With an dynamic add there is no problem , no problem with a dynamic sizing of the panel too
Thank you for your answer
-
31 May 2010 5:48 AM #2
You want to remove the ContentPanel or all children ofthis ContentPanel? With your code you remove all children of that contentpanel.
-
31 May 2010 5:50 AM #3
All children of the panel in order to have a "blank" panel ...
-
31 May 2010 5:52 AM #4
Than that code is correct. If it is not working, please post a fully working testcase that implements EntryPOnit
-
31 May 2010 8:40 AM #5
I found the origin of the problem
My panel doesn't contain classic component but my own component which extend composite (of GWT librairie)
My component :
With my own component, the removeAll of the panel doesn't work. Component stay on the screenCode:public class ComplexField extends Composite { ElementType myElement; int size; String label; HorizontalPanel horizontalPanel; public ComplexField(ElementType element,int size,String htmlLabel) { this.myElement=element; this.size=size; this.label = htmlLabel; horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(10); } public ElementType getMyElement() { return myElement; } public void removeAll() { HorizontalPanel horizontalPanel = (HorizontalPanel)this.getWidget(); horizontalPanel.removeAll(); horizontalPanel.layout(); } }
So I add the removeAll function on my component and I call it before calling removeAll of the Panel
Code:ContentPanel panel = (ContentPanel)this; for(int i=0;i<panel.getItemCount();i++) { ComplexField cf = (ComplexField)panel.getWidget(i); cf.removeAll(); } panel.removeAll(); panel.layout();
Like this, it's works but I am not sure of the solution ...
Is It normal ?
Thank you
Similar Threads
-
How to remove the background-image of contentpanel
By rameshr in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 13 Nov 2009, 5:07 AM -
[2.0b1][CLOSED] FieldSet component remove doesn't remove label
By iaresean in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 15 Oct 2007, 2:25 AM -
Howto properly remove contentpanel overflow.
By wajatimur in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 28 May 2007, 6:17 AM -
add and remove ContentPanel tabs
By brunnolou in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 7 May 2007, 10:35 AM -
Trigger to remove ContentPanel
By flinden68 in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 19 Dec 2006, 9:51 AM


Reply With Quote