On 29-07-2010 at 06:26, spliffy wrote:
> I'm using the stripes layout manager. included in my 'header.jsp' is a nav
> bar. I'm looking for an elegant way to highlight the currently selected page
> in the nav bar. The best I 've come up with so far is to pass a
> 'pageSelected' parameter in my pages, like so: 
> 
> <stripes:layout-render name="/layout/default.jsp" pageSelected="AboutUs">
> 
> and then have lots of <c:if></c:if> to check the value in my header.jsp and
> apply styles where appropriate. However, it seems so clunky and is not easy
> to maintain - is there a more elegant solution that i've missed?

You could use CSS, and name your tabs:

        ol.menu { /* normal, unselected style */ }
        ol.menu li { /* usual style */ }

        ol.tab1selected li#tab1,
        ol.tab2selected li#tab2,
        ol.tab3selected li#tab3 { /* selected style */ }


With a JSP snippet like this:
        <ol class="menu ${activeTab}selected">
                <li id="tab1">Tab 1>
                <li id="tab2">Tab 1>
                <li id="tab3">Tab 1>
        </ol>




-- 
   ,-_
  /() ) Oscar Westra van Holthe - Kind      http://www.xs4all.nl/~kindop/
 (__ (
=/  ()  A half truth is a whole lie.  -- Yiddish Proverb

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to