• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Wonder-disc] How to escape from an Ajax Request without use of Direct Actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wonder-disc] How to escape from an Ajax Request without use of Direct Actions


  • Subject: Re: [Wonder-disc] How to escape from an Ajax Request without use of Direct Actions
  • From: Amedeo Mantica <email@hidden>
  • Date: Thu, 28 Jan 2010 23:50:43 +0100

Ok Chuck

I was thinking you got confused by the string "<script>document.location.href='';</script>" in my original post
I'll do the checks you succested me!
Thanks
Amedeo

On 28/gen/2010, at 22.05, Chuck Hill wrote:


On Jan 28, 2010, at 12:32 PM, Amedeo Mantica wrote:

?

I have no <script>document.location.href='';</script>
that is when i use direct actions

My turn: ?

If the response type is text/html and there are no script tags, it won't get evaluated as a script.  AjaxUtils.redirectTo will result in  <script>document.location.href="" getting added to the response.  If the response type is text/_javascript_, there won't be script tags.

Chuck


On 28/gen/2010, at 19.42, Chuck Hill wrote:

Maybe the <script>document.location.href='';</script> is missing the script tags?  You will have to check the response content and  headers that are getting returned to the browser.

Chuck


On Jan 28, 2010, at 10:04 AM, Amedeo Mantica wrote:

Thanks Chuck

tried, but no luck

Amedeo

On 28/gen/2010, at 18.03, Chuck Hill wrote:


On Jan 28, 2010, at 7:48 AM, Amedeo Mantica wrote:

ubable to get both solutions working

i'll explain the problem better...

the redirect i need is inside the haldleException method

@Override
public WOResponse handleException(Exception _exception, WOContext _context) {

CFError erp = (CFError)pageWithName("CFError", _context);
erp.setTrace( _exception.getStackTrace() );
erp.setMessage( _exception.getMessage() );

WOResponse response = erp.generateResponse();

if (AjaxUtils.isAjaxRequest(_context.request() )) {
AjaxUtils.redirectTo(erp);
}

Try this

           if (AjaxUtils.isAjaxRequest(_context.request()))
           {
               AjaxUtils.redirectTo(erp);
               response = erp.context().response();
               _context.session().savePage(erp);
           }
           else
           {
               response = exceptionPage.generateResponse();
           }



return response;
}


but I still receive the error page rendered inside the AjaxUpdateContainer

Regards
Amedeo


On 27/gen/2010, at 18.30, Chuck Hill wrote:


On Jan 27, 2010, at 5:22 AM, Amedeo Mantica wrote:

Hello,

I have an Ajax action on my page, and works fine, but under some ecircustances, i need to get out from ajax request, so if the user click the action link, i get a new page instead of ajax response....

the easy way for me was use AjaxUtils.isAjaxRequest then generate a response with a <script>document.location.href='';</script>" and this works fine...

but how if I want to get a component action page and not a direct action ??

Regards
Amedeo

Use AjaxUtils.redirectTo(WOComponent component)


Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com_______________________________________________
Wonder-disc mailing list
email@hidden
https://lists.sourceforge.net/lists/listinfo/wonder-disc

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects










--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects










------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Wonder-disc mailing list
email@hidden
https://lists.sourceforge.net/lists/listinfo/wonder-disc

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [Wonder-disc] How to escape from an Ajax Request without use of Direct Actions
      • From: Anjo Krank <email@hidden>
  • Prev by Date: Re: Session being created continuously...
  • Next by Date: Re: Session being created continuously...
  • Previous by thread: Re: Core services design patern
  • Next by thread: Re: [Wonder-disc] How to escape from an Ajax Request without use of Direct Actions
  • Index(es):
    • Date
    • Thread