Can you tell me where I can find a tutorial on iteration in Tapestry?

Ernst

Inge Solvoll wrote:
You can use the For component to iterate through a set of objects that
contain parameters, link text or other things that you need. Read a tutorial
on iteration in Tapestry, and you can achieve what you want here very
smoothly! The java-file and the html-file cooperate in a nice way.

Inge

On 2/1/06, tapestry <[EMAIL PROTECTED]> wrote:

I do it in the .java- file because I get my imformation from the
database. The linktext is for each link diffrent. In your example I get
always the same text.


Norbert Sándor wrote:

Why can't you use For and DirectLink? I mean something like:

in .html file:

<span jwcid="[EMAIL PROTECTED]" source="ognl:{0,1,2,3,4,5,6,7,8,9,10}">
  <a jwcid="@DirectLink" parameters="ognl:components.for.value"
listener="listener:onClick">click me</a>
</span>

in .java file:

public void onClick(int value)
{
  System.out.println("link#" + value + " is clicked!");
}

(Of course this can be written nicer, I just wanted to give a short
example...)

BR,
Norbi

----- Original Message ----- From: "tapestry" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, January 30, 2006 12:09 PM
Subject: [NEWB]How to get the current link



I generaty some Links dynamicly like this:

protected void renderComponent ( IMarkupWriter writer ,IRequestCycle
cycle) {
int n = 10;
for( int i = 1; i <= n ; i++ ){
       writer.begin("component");
writer.attribute("name","showSiteLink");
writer.begin("a");
writer.attribute("href","link"+i);
writer.end();
writer.end();
}
}

So How can I get the current link I clicked, at runtime? I need it,
because I want to do diffrent thinks for.


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





--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.25/247 - Release Date: 2006.
01. 31.




---------------------------------------------------------------------
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]






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

Reply via email to