You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ognen Ivanovski <og...@netcetera.com.mk> on 2007/07/25 18:17:57 UTC

[T5] Specifying parameters in templates (apropos if / else)

I often look at:

  <t:if test="....">
    ...
    <t:parameter name="else">
       ....
    </t:parameter>
  </t:if>

and think if there could be a better (and yet generic) way to express  
this.

The only thing that comes to my mind is to use another namespace  
(with prefix p) and then  do something like:

  <t:if test="....">
    ...
    <p:else>
       ....
    </p:else>
  </t:if>

Of course this can easily confuse. One that doesn't know that else is  
a parameter to the component if, would expect more that both 'if' and  
'else' belong to the same namespace. Yet using the t prefix also for  
parameters will easily overload component types.

Just a thought comes back over and over again... What do you think?


--
Ognen Ivanovski | ognen.ivanovski@netcetera.com.mk
phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk




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


Re: [T5] Specifying parameters in templates (apropos if / else)

Posted by Howard Lewis Ship <hl...@gmail.com>.
It's a very, very good idea!

On 7/25/07, Ognen Ivanovski <og...@netcetera.com.mk> wrote:
>
> I often look at:
>
>   <t:if test="....">
>     ...
>     <t:parameter name="else">
>        ....
>     </t:parameter>
>   </t:if>
>
> and think if there could be a better (and yet generic) way to express
> this.
>
> The only thing that comes to my mind is to use another namespace
> (with prefix p) and then  do something like:
>
>   <t:if test="....">
>     ...
>     <p:else>
>        ....
>     </p:else>
>   </t:if>
>
> Of course this can easily confuse. One that doesn't know that else is
> a parameter to the component if, would expect more that both 'if' and
> 'else' belong to the same namespace. Yet using the t prefix also for
> parameters will easily overload component types.
>
> Just a thought comes back over and over again... What do you think?
>
>
> --
> Ognen Ivanovski | ognen.ivanovski@netcetera.com.mk
> phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495
> Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com