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 [...]
|