• 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 WebObjects Integration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AJAX WebObjects Integration


  • Subject: Re: AJAX WebObjects Integration
  • From: "Pierce T. Wetter III" <email@hidden>
  • Date: Tue, 23 May 2006 10:49:25 -0700

So exactly what problems are you having with dojo/wo? Consider that
the problem may be dojo, not WO in particular. You could easily
create a WODynamicElement for every new dojo tag, collect them in
components, and have something much easier to use then straight dojo.


I have tried to run the sample dojo application under WO, but without
success. I have the job to port an existing java-app to WO/AJAX. But without
official WO docs, i have no plan how to do this. I tried to run the dojo
example to understand how i can integrate a dojo widget and let it
communicate with the WO server.


The first problems arise with the following statements:

<script type="text/javascript" src="js/dojo/dojo.js"></script>
dojo.require("dojo.widget.Button2");


Well, you're missing HTML and Javascript..

This line is HTML:

<script type="text/javascript" src="js/dojo/dojo.js"></script>

This line is Javascript:
dojo.require("dojo.widget.Button2");

This should be:

<script type="text/javascript" src="js/dojo/dojo.js"></script>
<script type="text/javascript" >
	dojo.require("dojo.widget.Button2");
</script>

Also, the path you have is wrong, since its relative, you probably want a leading slash:

<script type="text/javascript" src="/js/dojo/dojo.js"></script>

Because otherwise its going to try to pull from "/cgi-bin/WebObjects/ YourApp.woa/js/dojo/dojo.js" or whatever instead of:

"/js/dojo/dojo.js"

I haven't done any WO stuff yet...



Then i have to call a java method on server on occurence of events to get
actual data. But you have said that this is possible with direct actions
using WOActionURL. I have to try it. But are direct actions compatible with
sessions?



Yes. Sessions are "optional" with direct actions, while they're not for "component actions", because a component action URL of the form:


  1.2.3.4

  means:

   go to 4th child of 3rd child of 2nd component of 1st page

which implies that the WO server has kept a history of all that so it can look up which component "1.2.3.4" references.




I also think, that from this example, dojo is a bit weak as a
Javascript toolkit. You'll spend a lot of time wiring stuff up in
Javascript with Dojo compared to Prototype. Or contrast dojo with the
Yahoo UI library:


I explored some AJAX libraries like RICO, but decided to use dojo, because
of the rich widget set. But i can you the yahoo toolkit too, if i can
integrate it easily in WO.



There's the zimbra toolkit too.



Pierce, can you write a small exaple app (Xcode project), just like the dojo
HelloWorld example, to show how the integration of the Yahoo UI (if you wish
Rico ...) can be accomplished in WebObjects? I think that i'm not the person
alone facing big problems with AJAX and WO.



No, because I don't have the spare time and I don't think it WO that's the problem, I think its the Ajax.


Adding "AJAX" to an application, no matter what the application framework is not an easy task. You have to understand the DOM, how javascript interacts with the DOM, the javascript library(ies) you're using, how the application server responds to requests, XML, how to generate XML with your application framework, SOAP and HTML.

Those are the foundations you have to build on. Once you have that under your belt, integrating with WO is trivial. There are some tricks you can do to make it easier like Mike's Ajax toolkit in Project Wonder has done, but that's icing.

Instead, forget completely about WO. The HelloWorld example seems to have disappeared, but it had almost no server side code in it anyways. Get dojo working in a plain .html file _first_. When you have that working. move the .html into a .wo file, and get that working (you'll have to fix things like the leading slash above). When you have that working, then you can worry about the "response" portion of Ajax, and that's when you'll need something like WOActionURL, or Mike's toolkit.

At that point, myself or others on the list can help you. But at that point you should be asking more detailed questions like "how do I build a URL to shove in this bit of JavaScript code". Rather than "how do I integrate Ajax with WO".

 Pierce

_______________________________________________
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: AJAX WebObjects Integration
      • From: Paul Lynch <email@hidden>
    • Re: AJAX WebObjects Integration
      • From: Mike Schrag <email@hidden>
  • Prev by Date: Re: Need help building an EOQualifier with session values
  • Next by Date: Re: Need help building an EOQualifier with session values
  • Previous by thread: WebObjects documents
  • Next by thread: Re: AJAX WebObjects Integration
  • Index(es):
    • Date
    • Thread