Struts, menu and navigation

Discussion in 'Java' started by ShadowMan, Jun 21, 2004.

  1. ShadowMan

    ShadowMan Guest

    hi all,
    I'm using Struts + Tiles framework and I'm facing a little problem with
    layouts...

    I use a simple layout with horizontal tabbed menu (sections) and a
    left-vertical submenu (actions).
    Some of these menus couldn't exist depending on user profile.
    I would synchronize _selected_ tab-menu with vertical menu wich taglib /
    default layout / navigation-system package do you suggest for this purpose?!
    Now I'm trying with first step using static menu defined inside
    tiles-definition.xml and I'm encountering troubles passing attributes to
    nested tiles...

    Any hint?
    --
    ShadowMan
    ShadowMan, Jun 21, 2004
    #1
    1. Advertising

  2. ShadowMan

    Muz Guest

    Shadowman,
    There are 2 approaches to this:

    1. Make all of your horizontal tabs launch separate struts modules (or
    even separate webapps), each one having
    it's own left-menu/body-content parts. They could all share the same
    horizontal menu tile. Some smart ANT build file
    could

    2. Write your own taglib to conditionally handle the left menu based
    on a value in the user's session (and/or
    which horizontal menu item was selected). Take a look at the tiles
    example tabs layout for hints to this.

    e.g.:

    tiles-defs.xml:
    <definition name=".tablayout.base"
    path="/jsp/layouts/nestedTabsLayout.jsp">
    <put name="selectedIndex" value="0" />
    <put name="parameterName" value="tabselected" />
    <putList name="tabList">
    <item value="Tab 1" link="/jsp/tab1.jsp" />
    <item value="Tab 2" link="/jsp/tab2.jsp" />
    <item value="Tab 3" link="/jsp/tab3.jsp" />
    </putList>
    </definition>


    nestedTabsLayout.jsp:
    <tiles:useAttribute name="parameterName" classname="java.lang.String"
    />
    <tiles:useAttribute id="selectedIndexStr" name="selectedIndex"
    ignore="true" classname="java.lang.String" />
    <tiles:useAttribute name="tabList" classname="java.util.List" />

    <%
    session.setAttribute( parameterName , new
    Integer(selectedIndexStr) );
    %>

    <logic:iterate id="tab" name="tabList"
    type="org.apache.struts.tiles.beans.MenuItem" >
    <myusertag:hasRoleFor parm1="<%=tab.getValue()%>"
    parm2="<%=selectedIndexStr%>">
    ....
    </myusertag:hasRoleFor>
    </logic:iterate>


    hope that helps
    Muz.


    "ShadowMan" <> wrote in message news:<cb6eko$>...
    > hi all,
    > I'm using Struts + Tiles framework and I'm facing a little problem with
    > layouts...
    >
    > I use a simple layout with horizontal tabbed menu (sections) and a
    > left-vertical submenu (actions).
    > Some of these menus couldn't exist depending on user profile.
    > I would synchronize _selected_ tab-menu with vertical menu wich taglib /
    > default layout / navigation-system package do you suggest for this purpose?!
    > Now I'm trying with first step using static menu defined inside
    > tiles-definition.xml and I'm encountering troubles passing attributes to
    > nested tiles...
    >
    > Any hint?
    Muz, Jun 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ShadowMan

    Struts and navigation

    ShadowMan, May 25, 2004, in forum: Java
    Replies:
    0
    Views:
    395
    ShadowMan
    May 25, 2004
  2. Replies:
    0
    Views:
    1,226
  3. Replies:
    1
    Views:
    367
  4. Laurahn
    Replies:
    3
    Views:
    886
    Steven Cheng[MSFT]
    Feb 6, 2007
  5. Philip
    Replies:
    1
    Views:
    299
Loading...

Share This Page