If you look in the JavaScript for this menu system, you can see the logic that's used. Basically, it tries to match based on URL, and then uses cookies if that doesn't work. The cookie is set when you click on a menu. It's somewhat fragile - you may be able to use a Velocity-based menu and put some logic in there to set the CSS class at rendering time, rather than post-rendering with JavaScript.
Matt On 11/7/06, Seamus O'Brien <[EMAIL PROTECTED]> wrote: > Hi there, > I've just started integrating tiles and struts menu (struts-menu-2.4.2) > and I was able to get the horizontal TabbedMenu working with my tiles (looks > good!). There are 2 basic problems I'm having still, they are: > > * how to keep a specific tab active > * how do I select a tab to be initially selected when the web page is first > accessed? > > There does not seem to be a lot of documentation regarding the MenuBase > class attributes, but I assume the answer must be using the "location" > attribute? I can't seem to get anything to work though. > > Here is my code: > > ---template.jsp---: > <menu:useMenuDisplayer name="TabbedMenu" > bundle="org.apache.struts.action.MESSAGE"> > <menu:displayMenu name="reports"/> > <menu:displayMenu name="products"/> > <menu:displayMenu name="settings"/> > </menu:useMenuDisplayer> > > <tiles:insert attribute="body"/> > > > --Tiles defintion.xml--: > <tiles-definitions> > <definition name=".templateDefinition" path="/template.jsp"> > <put name="title" type="string" value="Welcome"/> > <put name="header" value="topFrame.html" type="page"/> > <put name="menu" value="menu.jsp" type="page"/> > </definition> > > <definition name=".reports" extends=".templateDefinition"> > <put name="title" type="string" value="Reports"/> > <put name="body" value="/reports.jsp" type="page"/> > </definition> > > <definition name=".products" extends=".templateDefinition"> > <put name="title" type="string" value="Products"/> > <put name="body" value="/products.jsp" type="page"/> > </definition> > > <definition name=".settings" extends=".templateDefinition"> > <put name="title" type="string" value="Settings"/> > <put name="body" value="/settings.jsp" type="page"/> > </definition> > </tiles-definitions> > > > --menu-config.xml--: > <MenuConfig> > <Menus> > <Menu name="reports" title="Reports" action="/reports"/> > <Menu name="products" title="Products" action="/products"/> > <Menu name="settings" title="Settings" action="/settings"/> > </Menus> > </MenuConfig> > > > --struts-config.xml--: > <action > path="/reports" > forward=".reports"> > </action> > <action > path="/products" > forward=".products"> > </action> > <action > path="/settings" > forward=".settings"> > </action> > > The Reports & Products pages have links to other pages that I still want to > remain shown under the "Reports" or "Products" active tab, ie I have > showOldReports and showNewReports links under the Reports.jsp/Reports tab, > and a showOldProducts and showNewProducts links under the > Products.jsp/Products tab. Or to explain more simply - how can I link the > result several struts .do actions to a single menu tab, or even more simply > - several tiles definitions to a single tab menu. Does anyone know how to do > this? I have seen some posts about using javascript but that was back in > 2003 and I imagine that this has been made much easier to do now, right? The > other question then is how to initally select a tab, eg the second tab in > the list? > > Thanks for any help > Rory > > _________________________________________________________________ > Discover the magic of RSS feeds at MSN Ireland! http://ie.msn.com/ > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > struts-menu-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/struts-menu-user > -- http://raibledesigns.com ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ struts-menu-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/struts-menu-user
