Greg Miller wrote:
> I'm making good progress in using PWC.  So far it works as advertised and is
> quite easy to use.
>
> I've run into an issue that I don't know how to solve.  I'm creating a window
> and setting the content with setAjaxContent() which works perfectly.  However,
> there is a <select id="notecats"> in the html being loaded, but I can't always
> access it.  I've come to the conclusion that perhaps the ajax request hasn't
> finished by the time I want to fill the <select>.
>
> Is there a way to either submit the ajax request synchronously, or to somehow
> not continue until after the html is loaded?
>   

Yes, I have had to do this a lot in my code. The trick is to split 
things into two functions. In one you issue your ajax call using the 
regular prototype ajax.request function. In the oncomplete handler you 
call your second function and pass the ajax response. In the second 
function you create your window and use the win.getContent function to 
load the content data passed from the ajax call.

This may seem a little complicated, but in practice it works easily, 
since you only ever call the first function. The second is only called 
by the oncomplete of the ajax call. Conceptually, it is one function 
with a synchronous ajax call in the middle of it.

HTH,
-- Will




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

Reply via email to