EXT-GWT Portal: How to get all Portlets?

Posted by Lars on Stack Overflow See other posts from Stack Overflow or by Lars
Published on 2009-07-27T09:35:29Z Indexed on 2010/05/18 3:40 UTC
Read the original article Hit count: 431

Filed under:
|
|

Hi all this is my first Question here!

Im just making my first steps with (Ext-) GWT. I´m testing the Ext-GWT libraries and really: These are absolute great! Now my question: Is it possible to make a kind of "clear-Portal" or "hide all portles" for a defined Portal? Or have i always manually clear the portal like in my example code above? My sample code looks like this:

//define the Portal, 2 columns, each 50% auf width, with borders and Backgroundcolor
portal = new Portal(2);  
portal.setBorders(true);  
portal.setStyleAttribute("backgroundColor", "white");  
portal.setColumnWidth(0, .50);  
portal.setColumnWidth(1, .50);  

//define a Portlet for showing all Users
portletUser = new Portlet();  
portletUser.setHeading("Benutzer");  
configPanel(portletUser);  
portletUser.setLayout(new FitLayout());
CompUserList compUserList = new CompUserList();
portletUser.add(compUserList);  
portletUser.setHeight(250); 

//define a Portlet for showing all Vehicles
portletVehicles = new Portlet();  
portletVehicles.setHeading("Fahrzeuge");  
configPanel(portletVehicles);  
portletVehicles.setLayout(new FitLayout());
CompVehicleList compVehicleList = new CompVehicleList();
portletVehicles.add(compVehicleList);  
portletVehicles.setHeight(250);

//define a portlet for showing all countries
portletCountries = new Portlet();  
portletCountries.setHeading("Länder");  
configPanel(portletCountries);  
portletCountries.setLayout(new FitLayout());
CompCountryList compCountryList = new CompCountryList();
portletCountries.add(compCountryList);  
portletCountries.setHeight(250);

//add both Portlets to Portal
portal.add(portletUser, 0);
portal.add(portletVehicles, 1);

So first of all this works fine and looks great :-)

Now i have a a button in a accordeon menu. The Listener on this button should hide all portlets in the portal (at this time its the portletUser and portletVehicles) and then add another portlet (for example the portletCountries):

portletUser.hide();
portletVehicles.hide();
portal.add(portletCountries, 0)

Question from above again ;-) Is it possible to make a kind of "clear-Portal" or "hide all portles" for a defined Portal? Or have i always manually clear the portal like in my example code above?

What is the best practice for this functionallity?

Thanks all for your tips!

Lars.

© Stack Overflow or respective owner

Related posts about gwt

Related posts about ext-gwt