Re: Problem with Setting Target (Frame)
Matt Raible <[email protected]>
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Message-ID | <[email protected]> |
What displayer are you using? It sounds like a bug that (hopefully) can be fixed. BTW - I had to approve this message as you aren't subscribed to the mailing list. Regards, Matt On 1/18/06, Park, Michelle (Contr) <[email protected]> wrote: > > Please help: > I have a problem with setting a target (menuComponent.setTarget > ("<your_frame_target_name>"). > I'm displaying the menu tree in the left frame, and when one of the items > is selected, the details of the item needs be displayed in the right frame. > > This works fine ONLY if the item selected is a leaf node, which means the > item does not have any sub menu. > > Here is my code: > HttpSession session = request.getSession(); > MenuRepository repository = new MenuRepository(); > MenuRepository defaultRepository = > (MenuRepository)session.getServletContext().getAttribute( > MenuRepository.MENU_REPOSITORY_KEY); > > repository.setDisplayers(defaultRepository.getDisplayers > ()); > ArrayList wsList = workspaceList; > > for (int i=0; i < wsList.size(); i++) { > MenuComponent mc = new MenuComponent(); > WorkspaceTO to = (WorkspaceTO) wsList.get(i); > String workspaceName = to.getName(); > > mc.setName(workspaceName); > String parentWorkspace = to.getParentWorkspace(); > > if (parentWorkspace!=null) { //All workspaces have > parent workspace in this case. > MenuComponent parentMenu = > repository.getMenu(parentWorkspace); > if (parentMenu == null) { > parentMenu = new MenuComponent(); > parentMenu.setName > (parentWorkspace); > //parentMenu.setTarget("frmBody"); > repository.addMenu(parentMenu); > } > mc.setParent(parentMenu); > } > > if (workspaceName.equals("LIVE")) { > mc.setTitle("Workspace List:"); > mc.setAction(null); > }else { > mc.setTitle(workspaceName); > mc.setAction > ("/alternativeAnalysis/viewWorkspace.do?workspaceName="+workspaceName); > } > > /**********************************************************************************/ > mc.setTarget("frmBody"); // this is a right-hand > side frame name. > > /**********************************************************************************/ > repository.addMenu(mc); > } > mc.setTarget("frmBody") only works for the leaf node (menu w/o sub men in > the tree menu structure). > When I looked at the source code > Have any idea?? Please help me with this problem. > > Thank you. > Michelle >