You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by karthi <ra...@snovabits.net> on 2012/08/31 13:06:53 UTC
if/else if component
Hi everyone,
I have used if/else in tapestry, but can anyone tell me how to achieve
if/else if/else if/else
Thanks in advance
--
View this message in context: http://tapestry.1045711.n5.nabble.com/if-else-if-component-tp5715941.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: if/else if component
Posted by karthi <ra...@snovabits.net>.
Thanks for your replies..
@Michael: Case technique is really a helpful one, it suits.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/if-else-if-component-tp5715941p5715947.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: if/else if component
Posted by Michael Prescott <mi...@gmail.com>.
You could try the 'Case' technique.
http://tapestry.apache.org/switching-cases.html
On 31 August 2012 07:06, karthi <ra...@snovabits.net> wrote:
> Hi everyone,
>
> I have used if/else in tapestry, but can anyone tell me how to achieve
>
> if/else if/else if/else
>
> Thanks in advance
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/if-else-if-component-tp5715941.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: if/else if component
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 31 Aug 2012 08:17:10 -0300, Christian Riedel
<cr...@googlemail.com> wrote:
> <t:if t:test="prop1">
> <p:else>
> <t:if t:test="prop2">
> you mean this???
> </t:if>
> </p:else>
> </t:if>
I really dislike this way of writing If's, as the else part is inside the
if and the indentation makes it very confusing. I recommend everyone doing
this instead:
<t:if t:test="prop1">
if
</t:if>
<t:if t:test="!prop1>
else
</t:if>
If your method that provides the test has expensive calls, just annotate
it with @Cached so Tapestry calls it only once per request and reuses the
returned value in subsequent calls.
I think the else parameter of the If component was only created because,
at that time, the prop binding didn't support the ! operator yet.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: if/else if component
Posted by Christian Riedel <cr...@googlemail.com>.
<t:if t:test="prop1">
<p:else>
<t:if t:test="prop2">
you mean this???
</t:if>
</p:else>
</t:if>
Am 31.08.2012 um 13:06 schrieb karthi:
> Hi everyone,
>
> I have used if/else in tapestry, but can anyone tell me how to achieve
>
> if/else if/else if/else
>
> Thanks in advance
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/if-else-if-component-tp5715941.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org