Great point, worthy of consideration. 

"Choose" has an advantage over sequential If components: only one of the tests 
will succeed, whereas with sequential Ifs the value being tested can change 
before the next If.

And "Choose" has an advantage over the "else" parameter block, being that it is 
much easier to read.

On 14/11/2012, at 3:33 AM, Lance Java wrote:

> In JSTL, there is a "choose" tag [1] which I think is a more elegant way of
> handling the else condition. Perhaps tapestry could benefit from a similar
> component?
> 
> <t:choose>
>   <t:when test="foo">Foo</t:when>
>   <t:when test="bar">Bar</t:when>
>   <t:else>Baz</t:else>
> </t:choose>
> 
> [1] http://www.tutorialspoint.com/jsp/jstl_core_choose_tag.htm
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Showing-a-Block-condirionally-tp5717967p5717985.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to