Hmm... output optional content or an entirely different rendering for the
first object or last object? In my case (www.thedailytube.com) the first
object rendered is highlighted with a bigger image and more text of the
description displayed. In an email application your thread page you might
only want to show the full contents of the last entry and minimized entries
for the rest.

Currently I'm just testing _index == 0 from within my component, but it'd be
handy if I didn't have to define the _index and could just call
_loop.getIsFirst() when picking CSS, or <t:if test="loop.isFirst"> when
selecting the components to render.

I think that creating a simple delimited string is something that should be
easy to do, but I don't think it makes sense to tack it on to the loop
component. It'd be better to make it trivial to write your own component, or
use the features of the component to get that effect.

Josh

On Jan 14, 2008 9:03 AM, Chris Lewis <[EMAIL PROTECTED]> wrote:

> Out of curiosity and within the scope of markup rendering in a looping
> context, what would one do with with isFirst/isLast knowledge, apart
> from using it to insert a delimiter?
>
> Josh Canfield wrote:
> > Adding delimiter to the loop component sounds like a poor design
> > choice to me. It seems like the right thing to do would be to make
> > isFirst/isLast type attributes available from the loop.
> >
> >
> >
> > Sent from my iPhone
> >
> > On Jan 14, 2008, at 7:41 AM, Chris Lewis <[EMAIL PROTECTED]>
> > wrote:
> >
> >> Thanks for the reminder. As a note to others interested in this
> >> thread, I created a JIRA suggesting the addition of a delimiter
> >> parameter in the Loop.
> >>
> >> https://issues.apache.org/jira/browse/TAPESTRY-2043
> >>
> >> chris
> >>
> >> Howard Lewis Ship wrote:
> >>> I have been keeping the nightly documentation up to date with these
> >>> changes.
> >>>
> >>> Please look at http://tapestry.formos.com/nightly/tapestry5 and dig
> >>> down from there.
> >>>
> >>> The main site will only be updated when a new release is generated,
> >>> the nightly is ... well, nightly.
> >>>
> >>> On Jan 12, 2008 2:04 PM, Chris Lewis <[EMAIL PROTECTED]>
> wrote:
> >>>
> >>>> So this ticket has been implemented in svn:
> >>>> https://issues.apache.org/jira/browse/TAPESTRY-2028
> >>>>
> >>>> And now I need whitespace... so how can I get it back? Is there or
> >>>> isn't
> >>>> there a way to disable this? Im using loop to output links
> >>>> (pagelinks),
> >>>> and i have whitespace behind in the body so there is separation.
> >>>> Unfortunately, it's getting stripped. Is there a workaround?
> >>>>
> >>>> On a related note, is there a way to know if im on the last
> >>>> iteration of
> >>>> the loop, so i could for example, follow all but the last with a ","?
> >>>> This may be outside the scope of loop as currently implemented, but i
> >>>> can see it being useful.
> >>>>
> >>>> chris
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Reply via email to