Tapestry automatically assigns unique id to every object in the page. it is
created something along the lines of id underscore number (id, id_0, id_1,
id_2). However, if the event handler that handles the actionlink click
should receive the actionId then it should be the context.
context="item.actionId"

and then in Java

Object onActionFromMyAction(Long actionId){
 ... do stuff ...
 return where-to-go (see
http://tapestry.apache.org/tapestry5/guide/pagenav.html)
} 

Also try to drop the t: from the id clause. That might let tapestry to treat
the id as html parameter instead of tapestry id. Dont know if that is
generally advisable, but I've used it couple of times. (This of course works
only if you need just the ids to client side.)

 - Ville

<div id="navigation"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
<table>
<tr><td>
 <ul>
  <t:loop source="itens" value="item">
    <li id="${item.menuId}">
        <t:actionlink t:zone="content" t:id="myAction" id="${item.actionId}"
context="item.actionId">${item.menuDescription}</t:actionlink>
   </li>
  </t:loop>                     
 </ul>
</td></tr>
</table>        
</div>



andrethiago wrote:
> 
> Hi all!
> 
> I want to build a menu inside a loop. Something like this:
> 
> <div id="navigation"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> <table>
> <tr><td>
>  <ul>
>   <t:loop source="itens" value="item">
>     <li id="${item.menuId}">
>       <t:actionlink t:zone="content"
> t:id="${item.actionId}">${item.menuDescription}</t:actionlink>
>    </li>
>   </t:loop>                   
>  </ul>
> </td></tr>
> </table>      
> </div>
> 
> I want to generate the Actionlink id dinamically. But
> t:id="${item.actionId}" does not work. Can anyone give me a way to do
> this?
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-set-actionlink-id-dynamically-tp22148516p22157988.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to