You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Smoak <We...@asu.edu> on 2003/12/04 18:07:00 UTC

RE: Tab Layout in Struts !!

Vic wrote:
> Struts Menu does tabs (and trees) much better, example of a tab:
> http://www.raibledesigns.com/struts-menu

This looks great, but I'm currently using Tiles.  What would be involved
in switching?  I know nothing about Velocity, would that replace the
Tiles definitions?

For the OP...
> > I tried to use the tiles-example's tabsLayout but have a problem.

You've said what you want, but not what you've tried that didn't work.
Can you post your current tiles-defs and struts-config so we can see
what might be wrong?

> > * when click on the ADMIN tab, it will show the ADMIN 
> > contents if and only if it has logoned, otherwise, 
> > it will show the login page.
> > (both of the login page or the admin page are belongs to the ADMIN
tab,
> > so that the TAB selection is ADMIN)

AFAIK you can't conditionally switch which Tile you want-- if you're
using tiles-defs, then you define the tabs in advance.  What you can do
is have the contents of the tab, the JSP, display one thing or the other
based on however you're deciding if someone is logged in.

So your admin.jsp might have:
<c:if test="${user.loggedIn}">
  display some stuff
</c:if>
<c:if test="${not user.loggedIn}">
  display some different stuff
</c:if>

(or use choose/when/otherwise instead of the two ifs, or use logic:equal
if you prefer the Struts tags.)

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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


Re: Tab Layout in Struts !!

Posted by Vic Cekvenich <ce...@basebeans.com>.
 >
 >> I use it with tiles!
 >> Just the top tile is the menu.
 >> (Ex: tab1, option 1: goto /do/action1) configured with CSS for look 
and feel.
 >> So a simple menu 1st, and then you wil see tabs as no big deal.
 >>
 >> .V

Wendy Smoak wrote:
> Vic wrote:
> 
>>Struts Menu does tabs (and trees) much better, example of a tab:
>>http://www.raibledesigns.com/struts-menu
> 
> 
> This looks great, but I'm currently using Tiles.  What would be involved
> in switching?  I know nothing about Velocity, would that replace the
> Tiles definitions?
> 
> For the OP...
> 
>>>I tried to use the tiles-example's tabsLayout but have a problem.
> 
> 
> You've said what you want, but not what you've tried that didn't work.
> Can you post your current tiles-defs and struts-config so we can see
> what might be wrong?
> 
> 
>>>* when click on the ADMIN tab, it will show the ADMIN 
>>>contents if and only if it has logoned, otherwise, 
>>>it will show the login page.
>>>(both of the login page or the admin page are belongs to the ADMIN
> 
> tab,
> 
>>>so that the TAB selection is ADMIN)
> 
> 
> AFAIK you can't conditionally switch which Tile you want-- if you're
> using tiles-defs, then you define the tabs in advance.  What you can do
> is have the contents of the tab, the JSP, display one thing or the other
> based on however you're deciding if someone is logged in.
> 
> So your admin.jsp might have:
> <c:if test="${user.loggedIn}">
>   display some stuff
> </c:if>
> <c:if test="${not user.loggedIn}">
>   display some different stuff
> </c:if>
> 
> (or use choose/when/otherwise instead of the two ifs, or use logic:equal
> if you prefer the Struts tags.)
> 



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