Le jeudi 03 mai 2007 à 11:56 -0700, Howard Lewis Ship a écrit :
> I was just thinking about some of this on the way in.
> 
> 
> If you @Inject the ServiceResources into your Tree component, you can ask it
> to generate action links for you.  Handy!

Well, I succeeded in doing something... And Tapestry 5 is just amazing !

Now, I have a Tree component witch take a DefaultMutableTreeNode as
parameter and walk trough it in pre-order order, adding element at each
level swich, and write what I want for each node.

For exemple, if myTree has this structure :
8<---------------------
root
 |- node1
 |    |- node11
 |    `- node12
 |- node2
 `- node3
8<---------------------

and it is passed to my component in a template such as this :

8<---------------------
<t:tree source="mytree" currentnode="node" levelelement="ul">
  <li>
    <t:actionlink context="node.toString()">
      ${node.toString()}
    </t:actionlink>
  </li>
</t:tree>
8<---------------------

The rendered html will be :
8<---------------------
<ul>
  <li><a..>root</a><li>
  <ul>
    <li><a..>node1</a><li>
    <ul>
      <li><a..>node11</a><li>
      <li><a..>node12</a><li>
    </ul>
    <li><a..>node2</a><li>
    <li><a..>node3</a><li>
  </ul>
</ul>
8<---------------------

I'm a total beginner to T5 but that took me not a full day to understand
T5 base principles and code it... Wow. Really, Tapestry 5 is exiting.

Thanks for it, and I can't wait for the final version :)

Francois


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

Reply via email to