Mailing List webobjects-dev@wocommunity.org Message #145
From: Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org>
Subject: Mixup of AjaxModalDialog and AjaxUpateContainer on underlying page
Date: Fri, 16 Apr 2021 17:51:00 +0200
To: <webobjects-dev@wocommunity.org>
Signed Data (Text SHA256)
Folks,

I am fighting with the following issue:

AjaxTabbedPabelTab contains a list of items (WORepetition).
Any such item can have an AjaxModalDialogOpener to open an edit dialog for that particular item.
The edit dialog has a save button whose action in Java looks like the following

public WOActionResults resendRemoteRequest() {


// preparation and stuff

// compose and send out mail

EmailRequestingRemoteSignatureAndPayment mailComponent = pageWithName(EmailRequestingRemoteSignatureAndPayment.class);


mailComponent.setLink(url);
// more mailComponent.set(...)
try {
ERMailDeliveryHTML message = new ERMailDeliveryHTML();
message.setComponent(mailComponent);
message.setSubject("Please sign your contract with " + companyName);
message.setToAddress(availableEmailAddressesLoopvar.emailAddress());
message.setFromAddress(application().notificationSenderEmail());
message.sendMail();
}
catch (Exception ex) {
log.error("Error sending notification Email: " + ex.getMessage());
ex.printStackTrace();
dialogErrorMessage = "Failed to send Email";
AjaxModalDialog.update(context(), "ERROR - Could not send Email");
return null;
}


// everything is fine, let's save things
ec.saveChanges();


AjaxUpdateContainer.updateContainerID(REMOTE_REQUEST_UPDATE_CONTAINER_ID);
AjaxModalDialog.close(context());
return null;
}

Unfortunately I get very weird behavior...

Code written above returning both trigger for update and trigger to close dialog:
Dialog does not close and is dead in the water. No update happens, I have to manually reload the page in the browser. Then everything is fine.

Using updateContainerId binding on the AjaxSubmitButton that calls the above action and no call to trigger update from Java :
Dialog closes but the mail message text is pasted into the browser window! WHAT?! And no update happens (no data is reloaded)

No update container at all:
dialog closes properly, but nothing updates (of course)

What is going on here? How should I handle this stuff? I was thinking of returning a WORedirect, but how do I get the proper URL?

Thoroughly confused!
---markus---



Content Unaltered as verified By:
<markus.ruggiero@rucotec.ch>
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster