I am trying to remove all portlets from my portal and add new ones. The remove part works fine: portal.removeAll();
The issue occurs when I try to add a new portlet to the portal.
Code:
	        	if (event.getDescription().indexOf("Operating")>-1) {
		            chartPortlet = new ChartPortlet2();
		            portal.add(chartPortlet, 0);
				}
In debug modem I can see that the portlet is never added to the portal. The elementData for items is empty.
The code snippet works perfectly before using the removeAll() method. Has anybody some experience with the use of this method?

Thanks

Looks like I found a way to solve it: the trick is to remove all portlets for each column container, instead of removing all columns/portlets from the portal.
Code:
	        		 int col_count = portal.getItemCount();
	        		 LayoutContainer container = null;
	        		 Portlet portlet = null;
	        		 for (int i = 0; i < col_count; i++) {
	        			  container = portal.getItem(i);
	        			  container.removeAll();
	        		 }