You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Raul Cesar Teixeira <ra...@gmail.com> on 2005/11/03 19:07:44 UTC

Custom component

Hi,

I am trying to make a component that iterates over a list of strings,
and for each string, creates a link that will execute a specific
listener. Using a template for the component I was able to do what I
wanted by using a Foreach component and inside, using an ActionLink
for each element in my list of strings (actionStrings). The code below
is what I have on the template. Now I would like to do the same thing,
but without a template, that is, using a .JAVA class and implementing
the RenderComponent method. How can I create the embeded ActionLink
component in my renderComponent method?

<span jwcid="@Foreach" source="ognl:actionStrings" value="ognl:menuAction" >
<a jwcid="@ActionLink"
listener="ognl:pageListeners.getListener(menuAction.listenerName)" >
    </a>
</span>

Thanks,

Raul

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


Re: Custom component

Posted by Ron Piterman <rp...@gmx.net>.
You can add the (DirectLink) component to your page normally using the 
.jwc and the call its render(writer,cycle) method whenever you want it 
to render.
Cheers,
Ron


ציטוט Raul Cesar Teixeira:
> Hi,
> 
> I am trying to make a component that iterates over a list of strings,
> and for each string, creates a link that will execute a specific
> listener. Using a template for the component I was able to do what I
> wanted by using a Foreach component and inside, using an ActionLink
> for each element in my list of strings (actionStrings). The code below
> is what I have on the template. Now I would like to do the same thing,
> but without a template, that is, using a .JAVA class and implementing
> the RenderComponent method. How can I create the embeded ActionLink
> component in my renderComponent method?
> 
> <span jwcid="@Foreach" source="ognl:actionStrings" value="ognl:menuAction" >
> <a jwcid="@ActionLink"
> listener="ognl:pageListeners.getListener(menuAction.listenerName)" >
>     </a>
> </span>
> 
> Thanks,
> 
> Raul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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


Re: Custom component

Posted by Ron Piterman <rp...@gmx.net>.
problem is, to add a body - well -
without hacking much - just get a hold of the DirectService (inject it 
from infrastructure: from service:), create a ILink and add manually the 
<a href="..." using the margkup-writer.


ציטוט Raul Cesar Teixeira:
> Hi,
> 
> I am trying to make a component that iterates over a list of strings,
> and for each string, creates a link that will execute a specific
> listener. Using a template for the component I was able to do what I
> wanted by using a Foreach component and inside, using an ActionLink
> for each element in my list of strings (actionStrings). The code below
> is what I have on the template. Now I would like to do the same thing,
> but without a template, that is, using a .JAVA class and implementing
> the RenderComponent method. How can I create the embeded ActionLink
> component in my renderComponent method?
> 
> <span jwcid="@Foreach" source="ognl:actionStrings" value="ognl:menuAction" >
> <a jwcid="@ActionLink"
> listener="ognl:pageListeners.getListener(menuAction.listenerName)" >
>     </a>
> </span>
> 
> Thanks,
> 
> Raul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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