You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Allen <da...@mojavelinux.com> on 2003/06/06 09:33:12 UTC

concept for active tab

I have a site that has 6 or so main tabs.  I was thinking how I
would know which tab was active based on the page the user was
currently visiting.  I came up with one idea, but perhaps other
people have ideas as well.

In my tiles I set aside a variable name 'section' which by default
is "Home."  In each jsp page, I define the section variable to
equivalent to the section the page belongs to, else it will default
to "Home."  Then, when I render my master layout with the
navigation, I check to see if the section variable is equivalent to
the tab and if so, I display a highlighted tab.  Instead of putting
it in each jsp file I suppose I could make a mapping file of some
sort, but I haven't gotten that far yet.

Any other ideas?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Real programmers don't change their wardrobe too often: there 
are no clothes stores that are open at two o'clock in the morning. 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: concept for active tab

Posted by Dan Allen <da...@mojavelinux.com>.
Andrew Hill (andrew.david.hill@gridnode.com) wrote:

> Im not using tiles and tiles tabs but my app does have navigation links that
> need to be highlighted.
> These links come from a config file (navigation-config.xml) , which
> specifies such things as the links label key and the url to which it points
> (usually an action - but often with appended url parameters). (Most of my
> links are in a tree and the navigation renderer uses the navigation config
> to construct a javascript tree widget)
> 
> To work out which link to highlight , the renderer will compare the request
> path with whats in the config. It also does some comparisons based on the
> appended parameters so it knows which link to highlight when several point
> at the same base action path. It seems to work quite well.

Not to sound lazy, but do you have some code hacked up for this when
you say navigation-config.xml.  I guess I could use struts menu, but
I have already had to learn so many different components I am
running out of time.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Rumour has it that bad dreams about Windows can be ended by 
putting on a pair of Tux slippers and clicking your heels 
together 3 times while saying. 
"There's no place like /home." 
"There's no place like /home." 
"There's no place like /home."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: concept for active tab

Posted by Andrew Hill <an...@gridnode.com>.
Im not using tiles and tiles tabs but my app does have navigation links that
need to be highlighted.
These links come from a config file (navigation-config.xml) , which
specifies such things as the links label key and the url to which it points
(usually an action - but often with appended url parameters). (Most of my
links are in a tree and the navigation renderer uses the navigation config
to construct a javascript tree widget)

To work out which link to highlight , the renderer will compare the request
path with whats in the config. It also does some comparisons based on the
appended parameters so it knows which link to highlight when several point
at the same base action path. It seems to work quite well.

-----Original Message-----
From: Dan Allen [mailto:dan@mojavelinux.com]
Sent: Friday, 6 June 2003 15:33
To: Struts-User List
Subject: concept for active tab


I have a site that has 6 or so main tabs.  I was thinking how I
would know which tab was active based on the page the user was
currently visiting.  I came up with one idea, but perhaps other
people have ideas as well.

In my tiles I set aside a variable name 'section' which by default
is "Home."  In each jsp page, I define the section variable to
equivalent to the section the page belongs to, else it will default
to "Home."  Then, when I render my master layout with the
navigation, I check to see if the section variable is equivalent to
the tab and if so, I display a highlighted tab.  Instead of putting
it in each jsp file I suppose I could make a mapping file of some
sort, but I haven't gotten that far yet.

Any other ideas?

Dan

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Real programmers don't change their wardrobe too often: there
are no clothes stores that are open at two o'clock in the morning.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org