You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alfonso Quiroga <al...@gmail.com> on 2011/09/21 17:18:03 UTC

Confused with parameters

Hi! I'm a bit confused. I've written a small tree component which
iterates the tree and displays it, it work fine, but I write every
node in Java (using the MarkUpWriter)

Now I want the component more generic, so in the body of the component
I can write the node as I want, example:

<t:myTree source="someTree">
  Node: <strong> ${currentNode} </strong>
</t:myTree>

Now, the body is correctly displayed in every node, but I don't know
how to bind the 'currentNode' parameter. Is it possible to achieve
this?
Thanks in advance !!

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


Re: Confused with parameters

Posted by Alfonso Quiroga <al...@gmail.com>.
Thanks to Thiago, I could achieve this. It was really easy, I only
needed to have a parameter in my tree component with the currentNode.
So now it work like this:

 <t:myTree source="someTree" currentNode="node">
  Node: <strong> ${node} </strong>
 </t:myTree>

You have to define the "node" variable as a property in the page.
Bye!

On Wed, Sep 21, 2011 at 12:18 PM, Alfonso Quiroga
<al...@gmail.com> wrote:
> Hi! I'm a bit confused. I've written a small tree component which
> iterates the tree and displays it, it work fine, but I write every
> node in Java (using the MarkUpWriter)
>
> Now I want the component more generic, so in the body of the component
> I can write the node as I want, example:
>
> <t:myTree source="someTree">
>  Node: <strong> ${currentNode} </strong>
> </t:myTree>
>
> Now, the body is correctly displayed in every node, but I don't know
> how to bind the 'currentNode' parameter. Is it possible to achieve
> this?
> Thanks in advance !!
>

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