• 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: AJAX without Wonder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AJAX without Wonder?


  • Subject: Re: AJAX without Wonder?
  • From: Tom Pelaia <email@hidden>
  • Date: Tue, 10 Mar 2009 08:42:53 -0400

Hi,
Yes! I use AJAX in my WebObjects application and I don't use Wonder or any other add-on. WebObjects does have some explicit support for AJAX, but I don't use it. Instead, I simply use Direct Actions and make the calls from _javascript_ using the XHR. Here are the steps:
- Create a method to generate a Direct Action URL for each call you wish to make. You do this in the Java code of the component for which you wish to have the AJAX calls. The body of the method will look somenthing like: 	return context.directActionURLForActionNamed( "DirectAction/someOperation", query );
- Use the WO bindings to set the attribute of one or more element(s) on the page to the Direct Action URL(s)
- Create a _javascript_ handler to initiate the XHR call using the URL which it can retrieve from the target element using DOM.
- When the XHR callback is complete, you are given the contents which was generated from the Direct Action in the XHR response text and you can use it however you like (e.g. innerHTML or DOM depending on the content type you specified for your Direct Action response) to modify the HTML and/or DOM.
Once you get a simple example working, you will realize that it is straight forward and in my case, I wrote a _javascript_ class to handle the calls in a general way so it is now fairly cookie-cutter.
best regards,
tom
Hello all I have a question. Is there a way to use AJAX in WebObjects other than employing Wonder? I have rather large project and in fact I would not like to move it to using Wonder. I use AJAX for some tasks not related to modifying already displayed [...]
 _______________________________________________
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

  • Prev by Date: A problem sending a lot of emails in a Thread
  • Next by Date: Wolips not creating new project
  • Previous by thread: Re: AJAX without Wonder?
  • Next by thread: A problem sending a lot of emails in a Thread
  • Index(es):
    • Date
    • Thread