You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jabbar <aj...@gmail.com> on 2010/07/22 12:03:04 UTC

Custom tab panel

Hello all,

I'm trying to make a custom tab component. I want to use it like the
following

<t:tab source="tab1,tab2,tab3" active="tab1">

   <t:block t:id="tab1"
   </t:block>

   <t:block t:id="tab2">
   </t:block>

   <t:block t:id="tab3">
   </t:block>

</t:tab>

In my java tab component class I don't know how to refer to the potentially
variable number of blocks that can be inserted by the user.

-- 
Thanks

 A Jabbar Azam

Re: Custom tab panel

Posted by Jabbar <aj...@gmail.com>.
Hello Thiagi,

That's exactly what I did, before I read your email, and to my surprise it
worked.

On 22 July 2010 13:05, Thiago H. de Paula Figueiredo <th...@gmail.com>wrote:

> On Thu, 22 Jul 2010 07:03:04 -0300, Jabbar <aj...@gmail.com> wrote:
>
>  Hello all,
>>
>
> Hi!
>
>
>  In my java tab component class I don't know how to refer to the
>> potentially variable number of blocks that can be inserted by the user.
>>
>
> In your tab component, inject ComponenentResources and use the
> findBlock(String blockId) method to get them. Them use the Delegate
> component to render them.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
>
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Thanks

 A Jabbar Azam

Re: Custom tab panel

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 22 Jul 2010 07:03:04 -0300, Jabbar <aj...@gmail.com> wrote:

> Hello all,

Hi!

> In my java tab component class I don't know how to refer to the  
> potentially variable number of blocks that can be inserted by the user.

In your tab component, inject ComponenentResources and use the  
findBlock(String blockId) method to get them. Them use the Delegate  
component to render them.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Custom tab panel

Posted by Jabbar <aj...@gmail.com>.
I'm not sure how I can use this? Each block represents a tab and each tab
will have potentially different content. e.g.

<t:tab source="tab1,tab2,tab3" active="tab1">

   <t:block t:id="tab1"
         markup A
   </t:block>

   <t:block t:id="tab2">
        markup B
   </t:block>

   <t:block t:id="tab3">
        Markup C
   </t:block>

 </t:tab>


On 22 July 2010 11:22, Bryan Lewis <br...@maine.rr.com> wrote:

> Why not use a Loop in your component and pass in a List?
>
>
>
> On Thu, Jul 22, 2010 at 6:03 AM, Jabbar <aj...@gmail.com> wrote:
>
> > Hello all,
> >
> > I'm trying to make a custom tab component. I want to use it like the
> > following
> >
> > <t:tab source="tab1,tab2,tab3" active="tab1">
> >
> >   <t:block t:id="tab1"
> >   </t:block>
> >
> >   <t:block t:id="tab2">
> >   </t:block>
> >
> >   <t:block t:id="tab3">
> >   </t:block>
> >
> > </t:tab>
> >
> > In my java tab component class I don't know how to refer to the
> potentially
> > variable number of blocks that can be inserted by the user.
> >
> > --
> > Thanks
> >
> >  A Jabbar Azam
> >
>



-- 
Thanks

 A Jabbar Azam

Re: Custom tab panel

Posted by Bryan Lewis <br...@maine.rr.com>.
Why not use a Loop in your component and pass in a List?



On Thu, Jul 22, 2010 at 6:03 AM, Jabbar <aj...@gmail.com> wrote:

> Hello all,
>
> I'm trying to make a custom tab component. I want to use it like the
> following
>
> <t:tab source="tab1,tab2,tab3" active="tab1">
>
>   <t:block t:id="tab1"
>   </t:block>
>
>   <t:block t:id="tab2">
>   </t:block>
>
>   <t:block t:id="tab3">
>   </t:block>
>
> </t:tab>
>
> In my java tab component class I don't know how to refer to the potentially
> variable number of blocks that can be inserted by the user.
>
> --
> Thanks
>
>  A Jabbar Azam
>