You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raj Atchutuni <ra...@yahoo.com> on 2003/04/04 00:18:20 UTC
Re: Navigation (design question)
Can any one suggest smart way to design site navigation in Struts, Tiles. I worked out the solution using JavaScript, JSP. I feel there should be better and new ways of doing this navigation.
For example here is the code snippet which i already made it work. I am looking for better ways.
Explanation on snippet : Class is set using "CASE:" in java scriptlet to change the CSS class for different colors.
----------------- For submit -----------------
function changeGlobalAction(act, lnk)
{
document.topnav.action = act;
document.topnav.selectedTopNav.value = lnk;
<%
String topNav = (String) request.getParameter("selectedTopNav");
if(topNav != null && topNav.length() > 0)
{
session.setAttribute("selectedTopNav", topNav);
session.setAttribute("selectedSideNav", "1");
session.setAttribute("RESET_SIDE_NAV", "TRUE");
}
%>
document.topnav.submit();
}
----------------------------------------------------
<% if (option == 1)
{%>
<td width="71" class="<%= topNav1 %>" id="home">
<a href="#" onMouseOver="linkOn(this, 'home');"
onMouseOut="linkOff(this, '#');"
onclick="changeGlobalAction('/FAAO/home.do','1');">Home
</a>
</td>
<%}else{ %>
<td width="71" class="<%= topNav1 %>" id="home">
<a href="#" onMouseOver="linkOn(this, 'home');"
onMouseOut="linkOff(this, 'home');"
onclick="changeGlobalAction('/FAAO/home.do','1');">Home
</a>
</td>
<%}%>
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more