FW: [thelist] JSP Help

Hassan Schroeder hassan at webtuitive.com
Tue Jun 8 17:45:28 CDT 2004


Ani Phelan wrote:

> I don't want the nav to behave differently; I just want to be able to
> open additional navs, such as Wireless and Security, without the Routers
> nav staying open. With the code as it is, if I write the treenodeshow
> class to Wireless, then when I open Wireless, Routers will stay open...

Uh, that's not what I'm seeing; when I click on Wireless, I see a
"Coming Soon" in a sub-list but the Routers list collapses -- hence
my confusion :-)

However,

> <%
>             if (onPage.startsWith("/cisco/systems/switches/"))
>             OR (onPage.startsWith("/cisco/systems/wireless/"))
>             {
>             %>
> 
>             <%
>             }
>             else
>             {
> 		%>
>                 class="treenodeshow"                  
>             <%
>             }
>             %>
> 
> In the Routers <li class=""> would do the trick... except that that ^ of
> course, isn't valid...

? So call it class="dummy", or "null" or something.

<%
	String routerClass   = "null";
	String switchesClass = "null";
	String wirelessClass = "null";
	if (onPage.startsWith("/cisco/systems/routers/")) {
	  routerClass = "treenodeshow"; }
	if (onPage.startsWith("/cisco/systems/switches/")) {
	  switchClass = "treenodeshow"; }
	if (onPage.startsWith("/cisco/systems/wireless/")) {
	  wirelessClass = "treenodeshow"; }
%>
<li class="<%= routerClass %>">Routers
  ...
<li class="<%= switchesClass %>"> Switches
  ...
<li class="<%= wirelessClass %>"> Wireless
  ...

Note: this approach also minimizes the curly-brace proliferation of
the original code :-)

FWIW!
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.




More information about the thelist mailing list