[
https://issues.apache.org/jira/browse/TAP5-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Howard M. Lewis Ship updated TAP5-205:
--------------------------------------
Summary: Add an empty parameter to the Loop component, to display a message
when there are no items to loop over (was: Loop component: Add possibility to
specify a block when source iterable is empty)
> Add an empty parameter to the Loop component, to display a message when there
> are no items to loop over
> -------------------------------------------------------------------------------------------------------
>
> Key: TAP5-205
> URL: https://issues.apache.org/jira/browse/TAP5-205
> Project: Tapestry 5
> Issue Type: Improvement
> Affects Versions: 5.0.15
> Reporter: D. Marquis
> Assignee: Howard M. Lewis Ship
> Priority: Minor
> Fix For: 5.0.16
>
>
> I have a quick suggestion to improve the Loop component:
> We should be able to specify a block to display if the loop source is
> empty (size = 0)
> <div t:type="loop" source="anEmptyList">
> <t:parameter name="empty">There is no item matching your request</
> t:parameter>
> </div>
> I know we can do this :
> <t:if test="anEmptyList">
> <div t:type="loop" source="anEmptyList">
>
> </div>
> <t:parameter name="else">There is no item matching your
> request</t:parameter>
> </t:if>
> BUT this will have the result of calling the "getAnEmptyList()" getter
> in the component code twice.
> If you access the database in the getter (as the docs suggest quite a
> few times), this will call the database twice for nothing.
> Thanks ! :)
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]