On 12/11/06, Van <[EMAIL PROTECTED]> wrote:
> On 12/11/06, Van <[EMAIL PROTECTED]> wrote:
> > On 12/11/06, Felix Shnir <[EMAIL PROTECTED]> wrote:
> > > I'm not sure why you guys find this such a tough issue?  The content of 
> > > the
> > > Ajax call is populated into the content of the PWC.  That content it
> > > requested from the server via an ajax call.  Once the data gets loaded
> > > through an XHR, you can evaluate scripts.  Once scripts are downloaded and
> > > XHR switches to status 4, prototype evals and executes scripts (if any are
> > > set to execute).
> >
> > What do you mean by "if any are set to execute?"  I admit that I am
> > relatively new to using PWC and there is probably something I need to
> > do that will seem obvious once I understand it.
>
> I think I found what you are referring to via windows.js code
> inspection. Here is function executed for AJAX content requests:
>
>     _runAjaxRequest: function(message, parameters, callFunc) {
>         if (message.options == null)
>             message.options ={}
>         Dialog.onCompleteFunc = message.options.onComplete;
>         Dialog.parameters = parameters;
>         Dialog.callFunc = callFunc;
>
>         message.options.onComplete = Dialog._getAjaxContent;
>         new Ajax.Request(message.url, message.options);
>     },
>
> The docs say that you can pass options for an AJAX content request (I
> suspect this is inherited behavior for Prototype Ajax object and I'll
> find the documentation for it there, did I mention I'm fairly new to
> Prototype and AJAX in general :-)), but, I didn't see any
> documentation on what those options could be. It may be there and I
> missed it. In any case, it looks like I can pass an onComplete
> function of my own as one of the options.
>
> I'm going to give this a try and report back.

Now that I found the Prototype Ajax object documentation, I'm thinking
that in this particular case the simplest solution would be to make
the request a synchronous one. I know this is typically not
recommended. Our usage though is for a feedback form which loads
quickly and the user wouldn't expect or need to interact further with
the page while waiting for it to load. If I do it as a synchronous
request (one of the documented options for Ajax.request()), I can
simply put the NiftyLoad() call right after the Dialog.confirm() call
in my code DIV that gets evaluated to load the dialog already.

I'm going to try both ways just for the learning experience and report
back the results.

-Van
-- 
- Mike "Van" Riper
  [EMAIL PROTECTED]

_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

Reply via email to