On 12/11/06, Van <[EMAIL PROTECTED]> wrote:
> To make this concrete, here is the code DIV I use
> to do Dialog creation with AJAX loaded content:
>
> <div style="display:none" id="open_feedback_codediv">
> <xmp id="open_feedback">
> Dialog.confirm({url: "/components/feedback.jsp", options:
> {method: 'get'}},
> {windowParameters: {className: "kdialog", width:600,
> height:350, zIndex: 1500, resizable:false, recenterAuto:false, title:
> "Krillion Feedback...", showEffect:Effect.BlindDown, hideEffect:
> Effect.Fade, draggable:true}, okLabel: "Send",
> buttonClass: "myButtonClass",
> id: "myDialogId",
> cancel:function(win) {},
> ok:function(win)
> {sendFeedback(document.getElementById('feedForm'));
> window.setTimeout(Dialog.okTimeout,1500)}
> });
> </xmp>
> </div>
As promised, reporting back on my working solution. Here is code DIV
for my example changed to properly round the corners:
<div style="display:none" id="open_feedback_codediv">
<xmp id="open_feedback">
Dialog.confirm({url: "/components/feedback.jsp", options:
{method: 'get', asynchronous:false}},
{windowParameters: {className: "kdialog", width:600,
height:350, zIndex: 1500, resizable:false, recenterAuto:false, title:
"Krillion Feedback...", showEffect:Effect.BlindDown, hideEffect:
Effect.Fade, draggable:true}, okLabel: "Send",
buttonClass: "feedbackButtonClass",
id: "feedbackDialogId",
cancel:function(win) {},
ok:function(win)
{sendFeedback(document.getElementById('feedForm'));
window.setTimeout(Dialog.okTimeout,1500)}
});
NiftyLoad();
</xmp>
</div>
The critical change was adding "asynchronous:false" to the AJAX
request options. This allowed for simply calling NiftyLoad() right
after the Dialog.confirm() call with no timing issues. Theoretically,
providing a callback function as a separate AJAX request option and
allowing the AJAX request to be processed asynchronously should work
too. I was having problems attempting to get that way to work and for
my situation with a modal dialog the synchronous request approach is
working just fine. So, I'm not going to work further on the other
approach until I really need it for a non-modal window situation.
This was definitely an RTFM situation. There was a clear comment, "See
script.aculo.us Ajax.request documentation for details," with link to
the documentation I needed that I missed when quickly scanning the PWC
documentation earlier. My bad on that account.
-Van
--
- Mike "Van" Riper
[EMAIL PROTECTED]
_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com