EXT-GWT Portal:如何获取所有 Portlet?
大家好,这是我的第一个问题!
我刚刚迈出了使用 (Ext-) GWT 的第一步。 我正在测试 Ext-GWT 库,真的:这些非常棒! 现在我的问题是: 是否可以为定义的门户创建一种“清除门户”或“隐藏所有门户”? 或者我总是像上面的示例代码一样手动清除门户? 我的示例代码如下所示:
//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);
首先,这工作正常并且看起来很棒:-)
现在我在手风琴菜单中有一个按钮。 此按钮上的侦听器应隐藏门户中的所有 portlet(此时为 portletUser 和 portletVehicles),然后添加另一个 portlet(例如 portletCountries):
portletUser.hide();
portletVehicles.hide();
portal.add(portletCountries, 0)
又是上面的问题;-) 是否可以为定义的门户创建一种“清除门户”或“隐藏所有门户”? 或者我总是像上面的示例代码一样手动清除门户?
此功能的最佳实践是什么?
感谢大家的提示!
拉斯.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有使用过 Ext-GWT ——但是查看 Portal 的 Javadoc,我会尝试两件事:
或者更一般地说,将 Portal 包装在您自己的类中,该类记录 Portal 中的 Portlet ——然后您可以得到一个List而不是List。
I haven't used Ext-GWT -- but looking at the Javadoc for Portal there are two things I would try:
or, more generally, wrap a Portal in your own class which records the Portlets which are in the Portal -- then you can get a List rather than List.