You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ananya Goswami <an...@aztec.soft.net> on 2005/09/14 08:42:46 UTC

Hi how to add multiple lsteners to a form???

Hi All,

I am using Tapestry 4
And I need to implement 2 listeners for my form component in my Login Page
I tried this way but it is not working:-

<form jwcid="loginForm@Form" delegate="ognl:delegate"
listener="listener:onSubmit,doLogin">

and the code in my java file to load the cookie value in the text fields at
the time of user login page load.
Is the correct way to do???

public void doLogin(IRequestCycle cycle) {
    	String user_read_cookie =null;
  	user_read_cookie = cookieSource.readCookieValue("username_cookie");
	cycle.setAttribute("username",user_read_cookie);
    }

If this is not the right approach can u suggest a mechanism through which I
can implement the mechanism.

Thanks,
Ananya Goswami

RE: Hi how to add multiple lsteners to a form???

Posted by Patrick Casey <pa...@adelphia.net>.
	What are you actually trying to accomplish here? In other words, why
do you need two distinct listeners instead of one listener called
"doSubmitAndLogin"?

	--- Pat

> -----Original Message-----
> From: Ananya Goswami [mailto:ananyag@aztec.soft.net]
> Sent: Tuesday, September 13, 2005 11:43 PM
> To: 'Tapestry users'
> Subject: Hi how to add multiple lsteners to a form???
> 
> Hi All,
> 
> I am using Tapestry 4
> And I need to implement 2 listeners for my form component in my Login Page
> I tried this way but it is not working:-
> 
> <form jwcid="loginForm@Form" delegate="ognl:delegate"
> listener="listener:onSubmit,doLogin">
> 
> and the code in my java file to load the cookie value in the text fields
> at
> the time of user login page load.
> Is the correct way to do???
> 
> public void doLogin(IRequestCycle cycle) {
>     	String user_read_cookie =null;
>   	user_read_cookie = cookieSource.readCookieValue("username_cookie");
> 	cycle.setAttribute("username",user_read_cookie);
>     }
> 
> If this is not the right approach can u suggest a mechanism through which
> I
> can implement the mechanism.
> 
> Thanks,
> Ananya Goswami



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