tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2252) Support for EmbededComponent as Block without template tag
Date Wed, 12 Mar 2008 15:28:46 GMT

    [ https://issues.apache.org/jira/browse/TAPESTRY-2252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577872#action_12577872
] 

Howard M. Lewis Ship commented on TAPESTRY-2252:
------------------------------------------------

I think you made this too complicated.

How about:

<t:block>
  <p t:id="eri"/>
  <p t:id="route"/>
  <p t:id="barges"/>
  ...
</t:block>

Put them all inside an anonymous block.  That'll keep them from rendering normally with the
rest of the template.

You can provide a component instance to a Delegate component just as you can a Block.  Just
the component will render, not its siblings, and I think that gets you what you want.

Further, you can @Inject a Block instance.  Your @Component @Block doesn't make sense because
the field type, Finish, is your component type, not type Block ... that seems to indicate
a conflict that can't be resolved.

> Support for EmbededComponent as Block without template tag
> ----------------------------------------------------------
>
>                 Key: TAPESTRY-2252
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2252
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 5.0.12
>            Reporter: Davor Hrg
>            Priority: Minor
>             Fix For: unspecified
>
>
> I have a complex form with multiple steps,
> I've embeded the parts so I can notify them to reset state when new entity is loaded...
> but beside that it looks like this:
>     @Component private Eri _eri;
>     @Component private Route _route;
>     @Component private Barges _barges;
>     @Component private Consigments _consigments;
>     @Component private Containers _containers;
>     @Component private Finish _finish;
> and in the template I need:
> 	<t:block t:id="eri_block"          ><p t:id="eri"/></t:block>
> 	<t:block t:id="route_block"        ><p t:id="route"/></t:block>
> 	<t:block t:id="barges_block"       ><p t:id="barges"/></t:block>
> 	<t:block t:id="consigments_block"  ><p t:id="consigments"/></t:block>
> 	<t:block t:id="containers_block"   ><p t:id="containers"/></t:block>
>     <t:block t:id="finish_block"       ><p t:id="finish"/></t:block>
> It is not that much, but I'd prefer to not have to write the above code into template,
> there could be a parameter to mark the embeded component as a block
> so the framework is strict about this and to avoid problems with misspelled ids.
> something like this:
>     @Component(block=true) private Finish _finish;
> or
>     @Component @Block private Finish _finish;
> all these component need not render them selves, but will be included as 
> block inside a t:delegate, so their position in template is irrellevant.

-- 
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


Mime
View raw message