The error message is clear. This type of event does not support return
values from
event handler methods.

Please take a look at http://wiki.apache.org/tapestry/Tapestry5HowToUseForms

Dealing with multiple submits Capter.


On 8/8/07, Kolesnikov, Alexander GNI <[EMAIL PROTECTED]> wrote:
>
> I am playing with a simple T5 application that has two pages: Start and
> Another.
>
> The Start page contains the following:
>
> <p>
>         <a href="#" t:type="ActionLink" t:id="actionRedirect">Display
> Another page</a>
> </p>
> <t:form t:id="theForm">
>         <input type="submit" value="Submit"/>
>         <t:submit t:id="submitRedirect" value="Submit Redirect"/>
> </t:form>
>
> And here is the page class contents:
>
> @InjectPage
> private Another anotherPage;
>
> @OnEvent(value="submit", component="theForm")
> Object onFormRedirect() {
>         return anotherPage;
> }
>
> @OnEvent(component="actionRedirect")
> Object onActionRedirect() {
>         return anotherPage;
> }
>
> @OnEvent(component="submitRedirect")
> Object onSubmitRedirect() {
>         return anotherPage;
> }
>
> So basically the Start page provides three ways to navigate to Another
> page: by submitting the form (using HTML <input type="submit">), by
> clicking on the ActionLink and by by clicking on the Sunmit component.
> The latter, however, produces exception with the following message:
>
> Event 'selected' from Start:submitredirect received an event handler
> method return value of [EMAIL PROTECTED]
> from com.packtpub.foundations.pages.Start.onSubmitRedirect() (at
> Start.java:56). This type of event does not support return values from
> event handler methods.
>
> For me, this looks inconsistent. Okay, Submit control generates
> 'selected' event, not 'submit', not 'action', but wouldn't it be natural
> to be able to navigate to another page as a result of a Submit button
> press?
>
> Thanks,
>
> Alexander
>
>
>
> ------------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: If you have received this email in error, please
> immediately notify the sender by e-mail at the address shown.  This email
> transmission may contain confidential information.  This information is
> intended only for the use of the individual(s) or entity to whom it is
> intended even if addressed incorrectly.  Please delete it from your files if
> you are not the intended recipient.  Thank you for your
> compliance.  Copyright 2007 CIGNA
>
> ==============================================================================
>



-- 
Regards

Denny
Site: http://dengyin2000.javaeye.com

Reply via email to