On Feb 1, 2011, at 9:21 PM, Paul Hoadley wrote:

> Hi Chuck,
> 
> On 02/02/2011, at 2:40 PM, Chuck Hill wrote:
> 
>>>> You can also use the JS AMD.close(); to close it.  You should not NEED to 
>>>> do this, but it may provide a clue as to what is or is not wrong.
>>> 
>>> I've added that to the 'onComplete' binding, and it solves the problem 
>>> (with and without 'evalScripts="$true"').  It's a bit unsatisfying though—I 
>>> wonder why AjaxModalDialog.close(context()) is working for some buttons but 
>>> not others.
>> 
>> It has to be one of two things: 
>> - the "time to close" message is not getting to the server
>> - the "hide the dialog" message is not getting to the browser
>> 
>> The first implies the second.  Could there be a structure change in the page 
>> that is making the button not exist?  Otherwise, you will need to use the 
>> source and take a look at what is getting to the server and what is getting 
>> sent back.
> 
> There shouldn't be a structural change, no, but I will check.
> 
> Meanwhile, I've stumbled across what is presumably the relevant difference in 
> the action methods: the problem button's action method sends some emails 
> using (indirectly) ERMailDelivery.  At some point a WOComponent is created 
> (even for plain text mails—good templating system), for example:
> 
>       SuccessTextEmail component = 
> ERXApplication.erxApplication().pageWithName(SuccessTextEmail.class);
> 
> Commenting out the component creation (and returning some dummy text instead) 
> lets the AMD close as intended.  Is this component creation messing with the 
> operation of AjaxModalDialog.close(WOContext)?

As Timo pointed out, that will mess up the current context.  It might also mess 
with the response.  That is probably causing this code:

currentDialog(context).closeDialog();
AjaxUtils.javascriptResponse(AjaxModalDialog.Close, context);

to send back an unusable response.  I would be interested to know what is 
getting sent back to see if we can find a way to get the AMD to play nice.

Chuck

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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