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 17:20:08 UTC

Create tabs using struts

Hi
Is there a any facility to create tabs in struts?
I want to create a jsp page where user can click on
link in one tab and the selected link will open more
details in other tab, that way i dont have to reload
all the page each time user click on link, 
i am planning to use AJAX to update other tab


Ashish

__________________________________________________
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

Posted by Michael Jouravlev <jm...@gmail.com>.
The download page: https://sourceforge.net/project/showfiles.php?group_id=154342
The project homepage: http://jspcontrols.sourceforge.net/

Michael.

On 1/12/06, Ashish Kulkarni <ku...@yahoo.com> wrote:
>
> Hi
> Where can i download it and test it, also the URL for
> short desciption does not work
> --- Michael Jouravlev <jm...@gmail.com> wrote:
>
> > Will something like this work:
> >
> http://www.superinterface.com/jspcontrols/tabcontrol/
> > Here is a short description how to customize it:
> > http://www.jroller.com/page/javadujour/20060110
> >
> > Works in both Ajax and non-Ajax mode.
> >
> > Michael.
> >
> > On 1/12/06, Ashish Kulkarni
> > <ku...@yahoo.com> wrote:
> > > Hi
> > > Is there a any facility to create tabs in struts?
> > > I want to create a jsp page where user can click
> > on
> > > link in one tab and the selected link will open
> > more
> > > details in other tab, that way i dont have to
> > reload
> > > all the page each time user click on link,
> > > i am planning to use AJAX to update other tab
> > >
> > >
> > > Ashish

---------------------------------------------------------------------
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.


Re: Create tabs using struts

Posted by Wendy Smoak <ws...@gmail.com>.
On 1/12/06, Michael Jouravlev <jm...@gmail.com> wrote:

> 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 :-)

A 'roles' (plural) attribute that consults request.isUserInRole(...)
would be good.  (That's what Struts Menu has.)

Thanks,
Wendy

---------------------------------------------------------------------
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 Ashish Kulkarni <ku...@yahoo.com>.
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

Posted by Michael Jouravlev <jm...@gmail.com>.
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


Re: Create tabs using struts

Posted by Wendy Smoak <ws...@gmail.com>.
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)?

Thanks,
--
Wendy

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


Fwd: Create tabs using struts

Posted by Michael Jouravlev <jm...@gmail.com>.
Oops, bad URL for live demo. Here is the proper one:
http://www.superinterface.com/jspcontrols/tabcontrol/index.jsp

A short description how to customize it:
http://www.jroller.com/page/javadujour/20060110

Works in both Ajax and non-Ajax mode.

Michael.

On 1/12/06, Ashish Kulkarni <ku...@yahoo.com> wrote:
> Hi
> Is there a any facility to create tabs in struts?
> I want to create a jsp page where user can click on
> link in one tab and the selected link will open more
> details in other tab, that way i dont have to reload
> all the page each time user click on link,
> i am planning to use AJAX to update other tab
>
>
> Ashish

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


Re: Create tabs using struts

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi
Where can i download it and test it, also the URL for
short desciption does not work
--- Michael Jouravlev <jm...@gmail.com> wrote:

> Will something like this work:
>
http://www.superinterface.com/jspcontrols/tabcontrol/
> Here is a short description how to customize it:
> http://www.jroller.com/page/javadujour/20060110
> 
> Works in both Ajax and non-Ajax mode.
> 
> Michael.
> 
> On 1/12/06, Ashish Kulkarni
> <ku...@yahoo.com> wrote:
> > Hi
> > Is there a any facility to create tabs in struts?
> > I want to create a jsp page where user can click
> on
> > link in one tab and the selected link will open
> more
> > details in other tab, that way i dont have to
> reload
> > all the page each time user click on link,
> > i am planning to use AJAX to update other tab
> >
> >
> > Ashish
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


A$HI$H

__________________________________________________
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

Posted by Michael Jouravlev <jm...@gmail.com>.
Will something like this work:
http://www.superinterface.com/jspcontrols/tabcontrol/
Here is a short description how to customize it:
http://www.jroller.com/page/javadujour/20060110

Works in both Ajax and non-Ajax mode.

Michael.

On 1/12/06, Ashish Kulkarni <ku...@yahoo.com> wrote:
> Hi
> Is there a any facility to create tabs in struts?
> I want to create a jsp page where user can click on
> link in one tab and the selected link will open more
> details in other tab, that way i dont have to reload
> all the page each time user click on link,
> i am planning to use AJAX to update other tab
>
>
> Ashish

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


Re: Create tabs using struts

Posted by Sony Thomas <so...@genialgenetics.com>.
Hi Ashish,

If you get any way around in this problem please let me know. I am also 
facing the same problem

sony




Ashish Kulkarni wrote:


>Hi
>Is there a any facility to create tabs in struts?
>I want to create a jsp page where user can click on
>link in one tab and the selected link will open more
>details in other tab, that way i dont have to reload
>all the page each time user click on link, 
>i am planning to use AJAX to update other tab
>
>
>Ashish
>
>__________________________________________________
>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
>
>
>
>
>  
>


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