On Apr 8, 2009, at 9:38 PM, Chuck Hill wrote:

OK, first off ERXJavaScript is not Ajax technology so you want to avoid it when doing whizzy Web 2.0 stuff. They really don't play all that nicely together.

You can inherit from AjaxComponent and implement addRequiredWebResources something like this:

        protected void addRequiredWebResources(WOResponse response) {
ERXResponseRewriter.addScriptResourceInHead(response, context(), "Ajax", "prototype.js"); ERXResponseRewriter.addStylesheetResourceInHead(response, context(), "Ajax", "calendar.css"); ERXResponseRewriter.addScriptResourceInHead(response, context(), "Ajax", "calendar.js"); ERXResponseRewriter.addScriptResourceInHead(response, context(), "Ajax", "date.js");
        }

Or try putting similar code in appendToResponse.  Does that work?



Ok, putting it in appendToResponse and not subclassing AjaxComponent didn't work, so I now am subclassing it and it is loading the js files.

BUT.....

Because the js libraries I'm using are in turn loading other js files that are in their library with relative paths, it is causing a url like this to be generated:

http://localhost:21666/cgi-bin/WebObjects/Pulse.woa/wo/undefined../bespin/editor/component.js

which causes a js error:

failed loading undefined../bespin/editor/component.js with error: SyntaxError: Parse error


It looks as though this is something that dojo does. How does the ajax framework handle interdependent js files from libraries or are they uses the minified ones?

Greg




I tried doing it before calling super, but it complained that the session had died.

That seems... odd.


This was the response

<html>
<head><title>Missing Session Error</title></head>
<body>
<hr>
<strong>
Your session has timed out.</strong>
<hr>
</body>
</html>



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to