You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Chris Lewis (JIRA)" <de...@tapestry.apache.org> on 2008/01/14 16:37:35 UTC

[jira] Updated: (TAPESTRY-2043) Loop component could provide a parameter for delimiting its body for each iteration

     [ https://issues.apache.org/jira/browse/TAPESTRY-2043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Lewis updated TAPESTRY-2043:
----------------------------------

        Fix Version/s:     (was: 5.0)
                           (was: 5.0.8)
    Affects Version/s: 5.0.8
                       5.0

> Loop component could provide a parameter for delimiting its body for each iteration
> -----------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2043
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2043
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components, tapestry-core
>    Affects Versions: 5.0, 5.0.8
>            Reporter: Chris Lewis
>
> There are cases where one needs to output a list of data and delimit the items. In a simple situations, and in a world with perfect browsers, we could use CSS2 pseudo selectors to tack on trailng characters. In reality this is not an option, at least not now. Say a page has a list of strings like so:
> { "one", "two", "three" }
> The desired output is:
> one, two, three
> Currently this is not possible using the loop component. There are at least 2 solutions that could be implemented, each of which was suggested on the mailing list. The first is to improve the 'language' used by T5 to support more tests:
> <t:loop source="strings" value="var:string" index="var:index">
>   <a href="#" t:type="pagelink" page="nada" context="var:string">${var:string}</a>
>   <t:if test="var:index < strings.size()">,</t:if>
> </t:loop>
> I'm under the impression that the language will be improved to do such things, but in my opinion this delimiting function is a common enough need to recognized it by a parameter in the Loop component proper:
> <t:loop source="strings" value="var:string" delimiter=", ">
>   <a href="#" t:type="pagelink" page="nada" context="var:string">${var:string}</a>
> </t:loop>
> The logic would ensure that the output is only delimited and not create leading or trailing characters (if need they can be inserted outside of the component).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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