You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Karl <ka...@yahoo.com> on 2006/05/24 12:24:52 UTC

Reading component parameters in ITemplateSourceDelegate.findTemplate()

I'm trying to make custom component, which fetch its template from database.

@Component
abstract class DBTemplate extends BaseComponent
{
    // templateId is PK of stored in database template
    @Parameter
    public asbtract String getTemplateId();
}

Example:

<span jwcid="@DBTemplate" templateId="4"/>

I've made my own implementation of ITemplateSourceDelegate, and here is my 
question: how can read value of templateId inside ITemplateSourceDelegate.
findTemplate() method? I need this to know which template should be loaded from 
database.

Tapestry 4.0

TIA, Karl


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


Re: Reading component parameters in ITemplateSourceDelegate.findTemplate()

Posted by Karl <ka...@yahoo.com>.
One more thing - when component (extending BaseComponent) without template is 
found I see that my custom ITemplateSourceDelegate.findTemplate() method is 
called. But when Tapestry can't find page template it just throws exception 
without calling this method (page not found in namespace IIRC). According to 
API:

Acts as a delegate to the {@link org.apache.tapestry.services.TemplateSource}, 
providing access to *PAGE* and component templates after the normal search 
mechanisms have failed.

I've seen similar topics (loading templates from DB) many times - if someone 
could post complete example (with Hivemind related configuration) of custom 
ITemplateSourceDelegate implementation, I would be extremaly happy

TIA, Karl


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