you might want to take a look at
http://www.tapestrycomponents.org/Tassel/app?service=external/ViewComponent&sp=SJSCookMenu
for some existing menus and how this could be accomplished.
On 9/5/06, jake123 <[EMAIL PROTECTED]> wrote:
Hi, I am trying to create a custom component that will create a menu and
submenus to that menu on a completly dynamic web page. The entire site are
build up with "components" and I get the entire structure from the
database.
In the web layer I have a Object called SiteDTO that looks like this:
/* PRIVATE MEMBERS */
private List regionDTOList = new
ArrayList();
private List menuIdList = new ArrayList();
private Map menuItemMap = new HashMap();
private Map menuDTOMap = new HashMap();
private Map articleMap = new HashMap();
private Map articleListDTOMap = new
HashMap();
private Map portletMap = new HashMap();
all have getters and setters. My menuIdList contains the id value that is
the key in my menuDTOMap.
my MenuDTO.java is much simpler and looks like this
/* PRIVATE MEMBERS */
private Menu menu;
private List menuItemIdList = new ArrayList();
each menuDTO have a menuItemIdList containing the id that is the key value
in SiteDTO.menuItemMap.
I need to iterate through the first menuIdList and for each menuId pull
the
MenuDTO from MenuDTOMap. For each menuDTO I need to take the menuItemList
and iterate over that list to pull the MenuItem object that I need to
desplay in the html page along with the corresponding menu object.
How do I solve this the best way? I am thinking of creating a custom
component for this but I am kind of new to Tapestry and I could really
need
some good pointers. Should I try to iterate through this structure in the
page file or shall I do it in my component.java file? Is there any pros
and
cons for the different approach?
Thanks
Jacob
--
View this message in context:
http://www.nabble.com/Custom-Component---best-solution--tf2220888.html#a6152304
Sent from the Tapestry - User forum at Nabble.com.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Ed Ross
[EMAIL PROTECTED]