You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Tobias Wehrum (JIRA)" <de...@tapestry.apache.org> on 2008/07/09 15:35:32 UTC
[jira] Commented: (TAPESTRY-2213) Loop component: Add possibility
to specify a block when source iterable is empty
[ https://issues.apache.org/jira/browse/TAPESTRY-2213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612112#action_12612112 ]
Tobias Wehrum commented on TAPESTRY-2213:
-----------------------------------------
The same would be useful for the Grid component.
> Loop component: Add possibility to specify a block when source iterable is empty
> --------------------------------------------------------------------------------
>
> Key: TAPESTRY-2213
> URL: https://issues.apache.org/jira/browse/TAPESTRY-2213
> Project: Tapestry
> Issue Type: Improvement
> Components: Core Components
> Reporter: D. Marquis
> Priority: Minor
>
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org