<a href="${createURL}">click me</a>

You just have to provide getCreateURL() as a wrapper around
ComponentResources.createActionLink().

You don't instantiate a component, just @Inject the ComponentResources.

On Fri, Oct 31, 2008 at 5:24 PM, Marcel Sammut <[EMAIL PROTECTED]> wrote:
>
> Thanks for the quick response.  My delima is that I need to have a reference
> to the link in the .tml template.  I was hoping to just use a pure Java
> implementation to let the developer configure the menu via code.
> In order to do this, I believe I have to inject the ComponentResources
> object of my container when instantiating the AbstractLink component.  Any
> idea to do that?
>
> Thanks,
> Marcel
>
>
> Robert Zeigler wrote:
>>
>> Why not just use ComponentResources.createActionLink and
>> ComponentResources.createPageLink?
>>
>> .tml:
>>  $somelink Link Text
>> .java:
>>
>> @Inject
>> private ComponentResources resources;
>>
>> public String getSomeLink() {
>>    return
>> resources.createPageLink("mypage",true,contextValue1,contextValue2,...);
>> }
>>
>>
>> Robert
>>
>> On Oct 31, 2008, at 10/315:04 PM , Marcel Sammut wrote:
>>
>>>
>>> Greetings,
>>> I'm looking at porting my 3.0 tapestry web application to v5 and I'm
>>> trying
>>> to build a menu component which accepts a parameter of type
>>> ArrayList that
>>> contains a list of AbstractLink objects.  These items get rendered
>>> in a menu
>>> layout etc.  The page that this menu component exists on will
>>> create, at
>>> runtime, the set of desired menu item and pass them to the menu
>>> component.
>>>
>>> This sounds straight forward, however, I am unable to determin how to
>>> instantiate, for example, a new instance of a ActionLink.  In the
>>> previous
>>> version (3.0), I simply rendered the anchor myself and generated the
>>> URi in
>>> a custom implementation.  I was hoping that in T5, I would be able
>>> to use
>>> the internal Link components since they do pretty much what I was
>>> doing in
>>> 3.0.
>>>
>>> Is there a way, in code, to create a new ActionLink component and
>>> have it
>>> act as the model for another component to be rendered?
>>>
>>> Your thoughts are much appreciated.
>>> - Marcel
>>> --
>>> View this message in context:
>>> http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20274715.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/-T5--Creating-Links-At-Runtime-tp20274715p20275943.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to