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<RegionDTO> regionDTOList = new ArrayList<RegionDTO>(); private List<Long> menuIdList = new ArrayList<Long>(); private Map<Long, MenuItem> menuItemMap = new HashMap<Long, MenuItem>(); private Map<Long, MenuDTO> menuDTOMap = new HashMap<Long, MenuDTO>(); private Map<Long, Article> articleMap = new HashMap<Long, Article>(); private Map<Long, ArticleListDTO> articleListDTOMap = new HashMap<Long, ArticleListDTO>(); private Map<Long, Portlet> portletMap = new HashMap<Long, Portlet>(); 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<Long> menuItemIdList = new ArrayList<Long>(); 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]