Please look at the Delegate http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Delegate.html component as Daniel suggested. In combination with blocks, this fits your problem (see the example, it does exactly what you want).

Also remember Tapestry's "static structure, dynamic behaviour" paradigm. You can't manipulate a page's structure at runtime, i.e. all components have to be defined on the page.

Cheers,

Uli

Radek Terber schrieb:
Thanks for responses.

Using ajax  (via component "zone") is one of  possibly solutions. But,
ideally, i would like to solve this without Java Script - ideally all
should be done on server side.

I try refine my question. My idea was something like this:
--------
The component's "Index.tml"
<div xmlns:t=...>
    ... Some Boundary Begin ...
    <t:dynamicComponent t:source="requiredComponent" />      <!-- this
is the idea. It could be (eventually) parametrized using additional
attributes ... -->
    ... Some Boundary End ...
</div>


public class Index {

    @Inject
    private ComponentFactory componentFactory;     // or any other
service to obtaint component's instance, ComponentResources ...  ??

    public Object getRequiredComponent() {

       String pathToComponent = getPathFromAnywhere();
        AnyComponentClass componentInstance =
componentFactory.getOrLoadComponent(pathToComponent);   // or any other
way to obtain component's instance dynamically (without injection)
        // do something with "componentInstance"
        return componentInstance;
    }
}

There could be more ways to obtain component's instance: using path,
using component class, ...  ??
This is idea only. I do not know if something  such this is possible.

As far as I know, the component source in template  (e.g. something like
this: <t:component t:id="COMPONENT_SOURCE" />) is now reference to page
directly (or to field annotated as @Component(id = "COMPONENT_SOURCE")
... ) and there cannot be typed any expression (all typed here is
interpreted as component´s page link or ID, including brackets ${...}).

Radek Terber napsal(a):
Hi

Is there possibility to render components in T5 page "dynamically" (in
dependency on return value of any method in page´s class for example, or so) ?
Methods "onEvent..." return pages whose are rendered "dynamically" too -
each method can return many pages. I thing it would be possible allow
dynamic including components similar way, but i am not able to do it.

Thanks.

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



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

Reply via email to