You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "marioosh.net" <ma...@gmail.com> on 2009/12/11 14:18:32 UTC

ActionLink and onClick action

How to do onClick handler for my "ok" link (by annotation) ?

ActionLink doesn't work for me :(

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
	<t:actionlink t:id="ok">ok</t:actionlink>
</html>

public class Index {
	
	void onAction() {
		System.out.println("action");
	}
	@OnEvent(value = "action", component = "ok")
	void ok() {
		System.out.println("ok");
	}
	Object onActionFromOk() {
		System.out.println("ok2");
		return this;
	}
	@PageLoaded
	public void hello() {
		System.out.println("Hello :)");
	}
}


-- 
Pozdrawiam,
Mariusz

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


Re: ActionLink and onClick action

Posted by "marioosh.net" <ma...@gmail.com>.
Yes, i need to trigger some server-side code

2009/12/11, Thiago H. de Paula Figueiredo <th...@gmail.com>:
> Em Fri, 11 Dec 2009 11:50:44 -0200, marioosh.net <ma...@gmail.com>
> escreveu:
>
>> So... how to do something like <a href="#">ok</a> and handle onClick
>> event on it ?
>
> It depends. Do you need to trigger any server-side code or not?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Pozdrawiam,
Mariusz

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


Re: ActionLink and onClick action

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 11 Dec 2009 11:50:44 -0200, marioosh.net <ma...@gmail.com>  
escreveu:

> So... how to do something like <a href="#">ok</a> and handle onClick
> event on it ?

It depends. Do you need to trigger any server-side code or not?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


Re: ActionLink and onClick action

Posted by "marioosh.net" <ma...@gmail.com>.
So... how to do something like <a href="#">ok</a> and handle onClick
event on it ?

2009/12/11, Thiago H. de Paula Figueiredo <th...@gmail.com>:
> Em Fri, 11 Dec 2009 11:34:37 -0200, marioosh.net <ma...@gmail.com>
> escreveu:
>
>> This work:
>> <t:actionlink t:id="ok" t:zone="zone1">ok</t:actionlink>
>> This doesn't:
>> <t:actionlink t:id="ok">ok</t:actionlink>
>> <t:zone t:id="zone1"/>
>
> ActionLink nor EventLink can have any Javascript event hooked to them
> using the @OnEvent annotation (at least not yet). You have to write the
> Javascript yourself, unless you're using Zones.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Pozdrawiam,
Mariusz

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


Re: ActionLink and onClick action

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 11 Dec 2009 11:34:37 -0200, marioosh.net <ma...@gmail.com>  
escreveu:

> This work:
> <t:actionlink t:id="ok" t:zone="zone1">ok</t:actionlink>
> This doesn't:
> <t:actionlink t:id="ok">ok</t:actionlink>
> <t:zone t:id="zone1"/>

ActionLink nor EventLink can have any Javascript event hooked to them  
using the @OnEvent annotation (at least not yet). You have to write the  
Javascript yourself, unless you're using Zones.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


Re: ActionLink and onClick action

Posted by "marioosh.net" <ma...@gmail.com>.
This work:
<t:actionlink t:id="ok" t:zone="zone1">ok</t:actionlink>
This doesn't:
<t:actionlink t:id="ok">ok</t:actionlink>

<t:zone t:id="zone1"/>

What is going on ?

2009/12/11, marioosh.net <ma...@gmail.com>:
> How to do onClick handler for my "ok" link (by annotation) ?
>
> ActionLink doesn't work for me :(
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> 	<t:actionlink t:id="ok">ok</t:actionlink>
> </html>
>
> public class Index {
> 	
> 	void onAction() {
> 		System.out.println("action");
> 	}
> 	@OnEvent(value = "action", component = "ok")
> 	void ok() {
> 		System.out.println("ok");
> 	}
> 	Object onActionFromOk() {
> 		System.out.println("ok2");
> 		return this;
> 	}
> 	@PageLoaded
> 	public void hello() {
> 		System.out.println("Hello :)");
> 	}
> }
>
>
> --
> Pozdrawiam,
> Mariusz
>


-- 
Pozdrawiam,
Mariusz

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