You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Kulkarni <ku...@yahoo.com> on 2006/01/12 20:10:50 UTC

Re: Create tabs using struts- URL does not work

hi there
the short description URL
http://www.jroller.com/page/javadujour/20060110
does not work, give 403 error
Just one more question, i can i programmatically
decide which tab is to be displayed, for example, user
clicks a button on tab1 , can i open tab 2 and load
information and show it to user
Ashish

--- Michael Jouravlev <jm...@gmail.com> wrote:

> On 1/12/06, Wendy Smoak <ws...@gmail.com> wrote:
> > On 1/12/06, Michael Jouravlev <jm...@gmail.com>
> wrote:
> >
> > > Oops, bad URL for live demo. Here is the proper
> one:
> > >
>
http://www.superinterface.com/jspcontrols/tabcontrol/index.jsp
> >
> > Nice. :)  How would you you conditionally display
> each tab based on
> > user role(s)?
> 
> Right now there is no security-specific tag or
> attribute. What you can
> do now is either:
> 
> * surround each tab with Struts/JSTL conditional
> tags, or
> * create a tag/servlet that spits out only the tags
> that are
> appropriate for current component state (this would
> have to be my job,
> actually).
> 
> For example, this is how the Tigris-style tabs can
> be defined
> (copy/paste style):
> 
> === cut here ===
>   <table class="tabs" border="0" cellspacing="0"
> cellpadding="0">
>     <tr>
> 
>       <%-- First tab is active --%>
>       <c:if test='${empty currentTab || currentTab
> == "tab1"}'>
>         <table class="tigristabs" border="0"
> cellspacing="0">
>           <tr>
>             <th><jc:link event="tab1event"
> value="Tab1" /></th>
>             <td><jc:link event="tab2event"
> value="Tab2" /></td>
>           </tr>
>         </table>
>       </c:if>
> 
>       <%-- Second tab is active --%>
>       <c:if test='${currentTab == "tab2"}'>
>         <table class="tigristabs" border="0"
> cellspacing="0">
>           <tr>
>             <td><jc:link
> event="tab1event">Tab1</jc:link></td>
>             <th><jc:link
> event="tab2event">Tab2</jc:link></th>
>           </tr>
>         </table>
>       </c:if>
>     </tr>
>   </table>
> === cut here ===
> 
> You can put whatever you want into JSTL condition.
> The tab component
> that I have now is more of a template that you can
> adjust for your
> content and design, than a parameterizable tag. If
> you interested, see
> this short intro:
> http://www.jroller.com/page/javadujour/20060110
> 
> But nothing prevents me from putting this markup
> inside a Tab tag. I
> think I will do that, and I will add "role"
> attribute as well, just
> like you have in Struts Menu. Or do you want to have
> it in a different
> way? I am all ears :-)
> 
> I am doing my releases step by step, hopefully it
> won't take long for
> 1.0 version ;-) Thanks for heads up!
> 
> Michael.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Create tabs using struts- URL does not work

Posted by Michael Jouravlev <jm...@gmail.com>.
On 1/12/06, Ashish Kulkarni <ku...@yahoo.com> wrote:
> hi there
> the short description URL
> http://www.jroller.com/page/javadujour/20060110
> does not work, give 403 error

This is weird. Works for me. Would you try once again? Just in case, I
attached the content of that page with this email.

> Just one more question, i can i programmatically
> decide which tab is to be displayed, for example, user
> clicks a button on tab1 , can i open tab 2 and load
> information and show it to user

Of course. The tab component works like any other component created
with the library. It has two phases: input (accept) and output
(render). On render phase you can check whatever conditions/objects
you need, and activate this or that tab. On input phase you handle an
event that comes from the tab and you can decide how to update your
domain model. If interested, please download the sample war file and
see the page source code:
https://sourceforge.net/project/showfiles.php?group_id=154342

Michael.