That won't work for an Ajax request.  The interpretation of the event
handler method return value is different for Ajax requests than for
traditional requests.

Really, for page instances & etc., the Ajax handler should send (in
the JSON response) a special property to let the client redirect to
the new page.

Please add an issue about this and we'll see about getting it
implemented for the release candidate.

On Sat, Aug 23, 2008 at 2:27 PM, Sven Homburg <[EMAIL PROTECTED]> wrote:
> this should work:
>
> class FirstPage
> {
>  @Inject
>  private OtherPage page
>
>  Object myListener()
>  {
>    return page;
>  }
> }
>
>
> 2008/8/23 Markus Joschko <[EMAIL PROTECTED]>
>
>> Hi Andrew,
>> have you found the solution? I try the same but using the normal page
>> navigation patterns result into
>>
>>  Caused by: java.lang.RuntimeException: A component event handler
>> method returned the value profile/Profiles. Return type
>> java.lang.String can not be handled.  Configured return types are
>> org.apache.tapestry5.StreamResponse,
>> org.apache.tapestry5.json.JSONObject,
>> org.apache.tapestry5.runtime.Component,
>> org.apache.tapestry5.runtime.RenderCommand.
>>        at
>> org.apache.tapestry5.internal.services.ObjectComponentEventResultProcessor.processResultValue(ObjectComponentEventResultProcessor.java:39)
>>        at
>> $ComponentEventResultProcessor_11bf1136128.processResultValue($ComponentEventResultProcessor_11bf1136128.java)
>>        at
>> $ComponentEventResultProcessor_11bf1136126.processResultValue($ComponentEventResultProcessor_11bf1136126.java)
>>        at
>> org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper.handleResult(ComponentResultProcessorWrapper.java:42)
>>        at
>> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$15.handleResult(ComponentPageElementImpl.java:1008)
>>        at
>> org.apache.tapestry5.internal.services.EventImpl.storeResult(EventImpl.java:67)
>>
>>
>> Thanks,
>>  Markus
>>
>>
>>
>> On Sun, Apr 27, 2008 at 11:06 PM, Andrew Court <[EMAIL PROTECTED]>
>> wrote:
>> >
>> > Hi all,
>> >
>> > In T5, from an Ajax request, is it possible to redirect to a different
>> page?
>> >
>> > What I'm trying to do is something like below:
>> >
>> > Object onSomeAjaxRequest(){
>> >
>> >  if(some condition){
>> >  exit xhttp and jump to a different page
>> >  }
>> >  else{
>> >  return xhttp response to same page
>> >  }
>> >
>> > }
>> >
>> > But this doesn't seem to work.
>> >
>> > Thanks for any pointers,
>> > Andrew
>> > --
>> > View this message in context:
>> http://www.nabble.com/Return-page-from-ajax-request-tp16927742p16927742.html
>> > Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > 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]
>>
>>
>
>
> --
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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

Reply via email to