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]

Reply via email to