2009/6/5 Lukasz Jazgar <lukasz.jaz...@gmail.com>:
> Suppose, I have a component:
>
> ComplexComponent.tml
> <div>
>   ...
>   a lot of tags and components
>   ...
>           <span id="title">
>               .. complex content ..
>           </div>
>   ...
>   a lot of other tags and components
>   ...
> </div>
>
> ComplexComponent is very usefull. I use it repeatedly on pages. BUT in
> some cases I need "title" to be hyperlink to Tapestry page, in other
> cases hyperlink to another page, sometimes external hyperlink or
> "mailto:"; link. In other cases I need decorate it by border, complex
> and unrealizable by only CSS. And finally, I'd like to have
> possibility to define any other surrounding of title in the future,
> preferably without changing ComplexComponent.
>

I imagine such a solution:

ComplexComponent.java
@Parameter
@Property
Block titleDecorator;

ComplexComponent.tml
<div>
  ...
  a lot of tags and components
  ...
    <t:decorate by="titleDecorator">
          <span id="title">
              .. complex content ..
          </div>
    </t:decorate>
  ...
  a lot of other tags and components
  ...
</div>

Page.tml
<t:complexComponent>
   <t:titleDecorator>
        <t:pageLink page="otherPage"><t:decoratedBody/></t:pageLink>
   </t:titleDecorator>
</t:complexComponent>

Legend:
decorate - component a little bit similar to delagate
<t:decoratedBody/> - special tag like <t:body/> but relative to
containing Block.

It's a pity, that it is only imagination.
Is it possible to do something similar now?
If not, is it technically possible to make such a improvement in
future versions? It would be very powerful feature.


Lukasz

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

Reply via email to