• 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: AjaxModalContainer/Dialog with JS resources
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AjaxModalContainer/Dialog with JS resources


  • Subject: Re: AjaxModalContainer/Dialog with JS resources
  • From: Greg Hulands <email@hidden>
  • Date: Wed, 08 Apr 2009 22:06:30 -0700


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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: AjaxModalContainer/Dialog with JS resources
      • From: Chuck Hill <email@hidden>
References: 
 >AjaxModalContainer/Dialog with JS resources (From: Greg Hulands <email@hidden>)
 >Re: AjaxModalContainer/Dialog with JS resources (From: Chuck Hill <email@hidden>)
 >Re: AjaxModalContainer/Dialog with JS resources (From: Greg Hulands <email@hidden>)
 >Re: AjaxModalContainer/Dialog with JS resources (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: AjaxModalContainer/Dialog with JS resources
  • Next by Date: Re: Slow SQL slowing application - how to speed things up?
  • Previous by thread: Re: AjaxModalContainer/Dialog with JS resources
  • Next by thread: Re: AjaxModalContainer/Dialog with JS resources
  • Index(es):
    • Date
    • Thread