You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by James Hays <ja...@mac.com> on 2003/08/18 23:12:00 UTC

Tabbed NavBar component

I'm needing to develop a dynamic tabbed navbar component for use in my 
Tapestry app.  This seems like a pretty common component that I thought 
would have already been a part of tapestry, so I thought I would ask the 
community if anyone has developed such a component and would like to 
donate it to the community.  If one has not been built, I will build it 
and donate my version.

I need it to handle a default image and a selected image, commonly 
called as an up/down image.  That's about it.  I looked at the example 
under the RenderBlock component, but it seemed overly complex for what 
I'm doing.  I don't need to block pages from viewing, I just want each 
tab to act like a PageLink, linking to a component.

If there is an easier way to accomplish this, or if someone has already 
done this, please let me know.

Thanks.

James


Re: Tabbed NavBar component

Posted by James Hays <ja...@mac.com>.
That would be great.  I'll give you credit where I use it if you want.

James

Dustin Frazier wrote:

>I created a tabbed navigation bar that's pretty handy.  It's driven off a
>static meta-data structure for label, page name, sub-links, etc. (basically
>just a List of Maps), and it has a parameter 'selectedTab' which each page can
>set to show the appropriate tab as current.  The guts of the template looks
>like:
>
><table cellspacing=0 class=toptabs>
>  <tr>
>    <td jwcid="@Foreach" element="td" source="ognl:tabs.values"
>value="ognl:currentTab" class="ognl:classForCurrentTab"><a jwcid="@PageLink"
>page="ognl:currentTab.page"><div class=toptab-label><span jwcid="@Insert"
>value="ognl:currentTab.name"/></div></a>
>    </td>
>  </tr>
></table>
>
>I don't use images for the tabs, but it would be pretty easy to do.  The
>'selectedTab' parameter approach is useful because it allows multiple Tapestry
>pages to "show up" under the same top-level tab (think Amazon.com).  A use of
>the component in a page looks like:
>
><span jwcid="@TopTabs" selectedTab="Home"/>
>
>I'd be happy to share the detailed code if this seems similar to what you're
>trying to do...
>
>Dustin
>
>-----Original Message-----
>From: James Hays [mailto:james_hays@mac.com] 
>Sent: Monday, August 18, 2003 2:30 PM
>To: Tapestry users
>Subject: Re: Tabbed NavBar component
>
>
>Yes, it does, but in a Border component.  Maybe the best thing for me to 
>do is just extract the border bit from that component.
>
>Thanks.
>
>James
>
>Jamie Orchard-Hays wrote:
>
>  
>
>>Doesn't the workbench example do something like this?
>>
>>Jamie
>>
>>----- Original Message -----
>>From: "James Hays" <ja...@mac.com>
>>To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>Sent: Monday, August 18, 2003 5:12 PM
>>Subject: Tabbed NavBar component
>>
>>
>> 
>>
>>    
>>
>>>I'm needing to develop a dynamic tabbed navbar component for use in my
>>>Tapestry app.  This seems like a pretty common component that I thought 
>>>would have already been a part of tapestry, so I thought I would ask the 
>>>community if anyone has developed such a component and would like to 
>>>donate it to the community.  If one has not been built, I will build it 
>>>and donate my version.
>>>
>>>I need it to handle a default image and a selected image, commonly
>>>called as an up/down image.  That's about it.  I looked at the example 
>>>under the RenderBlock component, but it seemed overly complex for what 
>>>I'm doing.  I don't need to block pages from viewing, I just want each 
>>>tab to act like a PageLink, linking to a component.
>>>
>>>If there is an easier way to accomplish this, or if someone has 
>>>already
>>>done this, please let me know.
>>>
>>>Thanks.
>>>
>>>James
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>   
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>> 
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


RE: Tabbed NavBar component

Posted by Simon Raveh <Si...@nominum.com>.
I'll appreciate it if you post your code, I think I need to use a component
which is very similar to the one you just described.

--Simon

-----Original Message-----
From: Dustin Frazier [mailto:dustin@philanthropix.org]
Sent: Monday, August 18, 2003 4:41 PM
To: 'Tapestry users'
Subject: RE: Tabbed NavBar component


I created a tabbed navigation bar that's pretty handy.  It's driven off a
static meta-data structure for label, page name, sub-links, etc. (basically
just a List of Maps), and it has a parameter 'selectedTab' which each page
can
set to show the appropriate tab as current.  The guts of the template looks
like:

<table cellspacing=0 class=toptabs>
  <tr>
    <td jwcid="@Foreach" element="td" source="ognl:tabs.values"
value="ognl:currentTab" class="ognl:classForCurrentTab"><a jwcid="@PageLink"
page="ognl:currentTab.page"><div class=toptab-label><span jwcid="@Insert"
value="ognl:currentTab.name"/></div></a>
    </td>
  </tr>
</table>

I don't use images for the tabs, but it would be pretty easy to do.  The
'selectedTab' parameter approach is useful because it allows multiple
Tapestry
pages to "show up" under the same top-level tab (think Amazon.com).  A use
of
the component in a page looks like:

<span jwcid="@TopTabs" selectedTab="Home"/>

I'd be happy to share the detailed code if this seems similar to what you're
trying to do...

Dustin

-----Original Message-----
From: James Hays [mailto:james_hays@mac.com]
Sent: Monday, August 18, 2003 2:30 PM
To: Tapestry users
Subject: Re: Tabbed NavBar component


Yes, it does, but in a Border component.  Maybe the best thing for me to
do is just extract the border bit from that component.

Thanks.

James

Jamie Orchard-Hays wrote:

>Doesn't the workbench example do something like this?
>
>Jamie
>
>----- Original Message -----
>From: "James Hays" <ja...@mac.com>
>To: "'Tapestry users'" <ta...@jakarta.apache.org>
>Sent: Monday, August 18, 2003 5:12 PM
>Subject: Tabbed NavBar component
>
>
>
>
>>I'm needing to develop a dynamic tabbed navbar component for use in my
>>Tapestry app.  This seems like a pretty common component that I thought
>>would have already been a part of tapestry, so I thought I would ask the
>>community if anyone has developed such a component and would like to
>>donate it to the community.  If one has not been built, I will build it
>>and donate my version.
>>
>>I need it to handle a default image and a selected image, commonly
>>called as an up/down image.  That's about it.  I looked at the example
>>under the RenderBlock component, but it seemed overly complex for what
>>I'm doing.  I don't need to block pages from viewing, I just want each
>>tab to act like a PageLink, linking to a component.
>>
>>If there is an easier way to accomplish this, or if someone has
>>already
>>done this, please let me know.
>>
>>Thanks.
>>
>>James
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>


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


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


RE: Tabbed NavBar component

Posted by Dustin Frazier <du...@philanthropix.org>.
I created a tabbed navigation bar that's pretty handy.  It's driven off a
static meta-data structure for label, page name, sub-links, etc. (basically
just a List of Maps), and it has a parameter 'selectedTab' which each page can
set to show the appropriate tab as current.  The guts of the template looks
like:

<table cellspacing=0 class=toptabs>
  <tr>
    <td jwcid="@Foreach" element="td" source="ognl:tabs.values"
value="ognl:currentTab" class="ognl:classForCurrentTab"><a jwcid="@PageLink"
page="ognl:currentTab.page"><div class=toptab-label><span jwcid="@Insert"
value="ognl:currentTab.name"/></div></a>
    </td>
  </tr>
</table>

I don't use images for the tabs, but it would be pretty easy to do.  The
'selectedTab' parameter approach is useful because it allows multiple Tapestry
pages to "show up" under the same top-level tab (think Amazon.com).  A use of
the component in a page looks like:

<span jwcid="@TopTabs" selectedTab="Home"/>

I'd be happy to share the detailed code if this seems similar to what you're
trying to do...

Dustin

-----Original Message-----
From: James Hays [mailto:james_hays@mac.com] 
Sent: Monday, August 18, 2003 2:30 PM
To: Tapestry users
Subject: Re: Tabbed NavBar component


Yes, it does, but in a Border component.  Maybe the best thing for me to 
do is just extract the border bit from that component.

Thanks.

James

Jamie Orchard-Hays wrote:

>Doesn't the workbench example do something like this?
>
>Jamie
>
>----- Original Message -----
>From: "James Hays" <ja...@mac.com>
>To: "'Tapestry users'" <ta...@jakarta.apache.org>
>Sent: Monday, August 18, 2003 5:12 PM
>Subject: Tabbed NavBar component
>
>
>  
>
>>I'm needing to develop a dynamic tabbed navbar component for use in my
>>Tapestry app.  This seems like a pretty common component that I thought 
>>would have already been a part of tapestry, so I thought I would ask the 
>>community if anyone has developed such a component and would like to 
>>donate it to the community.  If one has not been built, I will build it 
>>and donate my version.
>>
>>I need it to handle a default image and a selected image, commonly
>>called as an up/down image.  That's about it.  I looked at the example 
>>under the RenderBlock component, but it seemed overly complex for what 
>>I'm doing.  I don't need to block pages from viewing, I just want each 
>>tab to act like a PageLink, linking to a component.
>>
>>If there is an easier way to accomplish this, or if someone has 
>>already
>>done this, please let me know.
>>
>>Thanks.
>>
>>James
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


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


Re: Tabbed NavBar component

Posted by James Hays <ja...@mac.com>.
Yes, it does, but in a Border component.  Maybe the best thing for me to 
do is just extract the border bit from that component.

Thanks.

James

Jamie Orchard-Hays wrote:

>Doesn't the workbench example do something like this?
>
>Jamie
>
>----- Original Message ----- 
>From: "James Hays" <ja...@mac.com>
>To: "'Tapestry users'" <ta...@jakarta.apache.org>
>Sent: Monday, August 18, 2003 5:12 PM
>Subject: Tabbed NavBar component
>
>
>  
>
>>I'm needing to develop a dynamic tabbed navbar component for use in my 
>>Tapestry app.  This seems like a pretty common component that I thought 
>>would have already been a part of tapestry, so I thought I would ask the 
>>community if anyone has developed such a component and would like to 
>>donate it to the community.  If one has not been built, I will build it 
>>and donate my version.
>>
>>I need it to handle a default image and a selected image, commonly 
>>called as an up/down image.  That's about it.  I looked at the example 
>>under the RenderBlock component, but it seemed overly complex for what 
>>I'm doing.  I don't need to block pages from viewing, I just want each 
>>tab to act like a PageLink, linking to a component.
>>
>>If there is an easier way to accomplish this, or if someone has already 
>>done this, please let me know.
>>
>>Thanks.
>>
>>James
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


Re: Tabbed NavBar component

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Doesn't the workbench example do something like this?

Jamie

----- Original Message ----- 
From: "James Hays" <ja...@mac.com>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, August 18, 2003 5:12 PM
Subject: Tabbed NavBar component


> I'm needing to develop a dynamic tabbed navbar component for use in my 
> Tapestry app.  This seems like a pretty common component that I thought 
> would have already been a part of tapestry, so I thought I would ask the 
> community if anyone has developed such a component and would like to 
> donate it to the community.  If one has not been built, I will build it 
> and donate my version.
> 
> I need it to handle a default image and a selected image, commonly 
> called as an up/down image.  That's about it.  I looked at the example 
> under the RenderBlock component, but it seemed overly complex for what 
> I'm doing.  I don't need to block pages from viewing, I just want each 
> tab to act like a PageLink, linking to a component.
> 
> If there is an easier way to accomplish this, or if someone has already 
> done this, please let me know.
> 
> Thanks.
> 
> James
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>