X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Markus Ruggiero (rucotec)" Received: from miniserver.rucotec.ch ([213.189.151.242] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25735759 for webobjects-dev@wocommunity.org; Sat, 17 Apr 2021 10:07:59 +0200 Received-SPF: none receiver=post.selbstdenker.com; client-ip=213.189.151.242; envelope-from=markus.ruggiero@rucotec.ch Received: from localhost (localhost [127.0.0.1]) by miniserver.rucotec.ch (Postfix) with ESMTP id 9386E27DFE9C for ; Sat, 17 Apr 2021 10:07:38 +0200 (CEST) Received: from miniserver.rucotec.ch ([127.0.0.1]) by localhost (miniserver.rucotec.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WG6zIUoPWA5S for ; Sat, 17 Apr 2021 10:07:36 +0200 (CEST) Received: from [192.168.56.49] (unknown [192.168.56.49]) by miniserver.rucotec.ch (Postfix) with ESMTPSA id B990A27DFE8F for ; Sat, 17 Apr 2021 10:07:36 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_C39EFE5F-2221-4CA2-91EB-40294CA56A43"; protocol="application/pkcs7-signature"; micalg=sha-256 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [WO-DEV] Mixup of AjaxModalDialog and AjaxUpateContainer on underlying page Date: Sat, 17 Apr 2021 10:07:36 +0200 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3608.120.23.2.4) --Apple-Mail=_C39EFE5F-2221-4CA2-91EB-40294CA56A43 Content-Type: multipart/alternative; boundary="Apple-Mail=_B55F6D56-D7FD-4F76-8EA1-818FF3425775" --Apple-Mail=_B55F6D56-D7FD-4F76-8EA1-818FF3425775 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Folks, it was a bad night I had and an even worse dream - but as it sometimes = happen I dreamed up the solution - and the keyword was WOContext! Instead of calling pageWithName() to instantiate the HTML mail contents = component (which instantiates it with the current WOContext) I now call = ERXApplication.instantiatePage(). This creates a fake WOContext for the = page and so its output will not make it into the current context=E2=80=99s= response. After fixing a small typo in the bindings of the update container = everything is now fine. Typo: myUC : AjaxUpdateContainer { id =3D = =E2=80=9CREMOTE_REQUEST_UPDATE_CONTAINER_ID=E2=80=9D; } Of course there should not be double quotes as = REMOTE_REQUEST_UPDATE_CONTAINER_ID is a final String constant in the = Java file. Thus the update container was never found and so no update = happened. I trigger the update container with the AjaxModalDialog binding =09 closeUpdateContainerID =3D REMOTE_REQUEST_UPDATE_CONTAINER_ID; Sometimes a bad night=E2=80=99s sleep helps wonders (Wonder? where did I = see that word that lately?) ---markus--- > On 16 Apr 2021, at 17:51, Markus Ruggiero (rucotec) = wrote: >=20 > Folks, >=20 > I am fighting with the following issue: >=20 > 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 >=20 > public WOActionResults resendRemoteRequest() { > =09 > // preparation and stuff >=20 > // compose and send out mail > EmailRequestingRemoteSignatureAndPayment mailComponent =3D= pageWithName(EmailRequestingRemoteSignatureAndPayment.class); > =09 > mailComponent.setLink(url); > // more mailComponent.set(...) > =09 > try { > ERMailDeliveryHTML message =3D 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 =3D "Failed to send Email"; > AjaxModalDialog.update(context(), "ERROR - Could = not send Email"); > return null; > } > =09 > // everything is fine, let's save things > ec.saveChanges(); > =09 > = AjaxUpdateContainer.updateContainerID(REMOTE_REQUEST_UPDATE_CONTAINER_ID);= > AjaxModalDialog.close(context()); > return null; > } >=20 > Unfortunately I get very weird behavior... >=20 > 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. >=20 > 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) >=20 > No update container at all: > dialog closes properly, but nothing updates (of course) >=20 > 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? >=20 > Thoroughly confused! > ---markus--- >=20 >=20 >=20 Markus Ruggiero rucotec GmbH web https://rucotec.ch Steinenvorstadt 79 email markus.ruggiero@rucotec.ch 4051 Basel / Switzerland mobile +41 79 508 4701 --Apple-Mail=_B55F6D56-D7FD-4F76-8EA1-818FF3425775 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Folks,

it = was a bad night I had and an even worse dream - but as it sometimes = happen I dreamed up the solution - and the keyword was = WOContext!

Instead of calling pageWithName() to instantiate the HTML = mail contents component (which instantiates it with the current = WOContext) I now call ERXApplication.instantiatePage(). This = creates a fake WOContext for the page and so its output will not make it = into the current context=E2=80=99s response.

After fixing a small typo in the = bindings of the update container everything is now fine.

Typo:
myUC : AjaxUpdateContainer { id =3D = =E2=80=9CREMOTE_REQUEST_UPDATE_CONTAINER_ID=E2=80=9D; }
Of course there should not be double quotes = as REMOTE_REQUEST_UPDATE_CONTAINER_ID is a final String constant in = the Java file. Thus the update container was never found and so no = update happened.

I trigger the update container with the AjaxModalDialog = binding  =
= closeUpdateContainerID =3D REMOTE_REQUEST_UPDATE_CONTAINE= R_ID;

Sometimes = a bad night=E2=80=99s sleep helps wonders (Wonder? where did I see that = word that lately?)

---markus---


On 16 = Apr 2021, at 17:51, Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org> wrote:

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 =3D = pageWithName(EmailRequestingRemoteSignatureAndPayment.class);

mailComponent.setLink(url);
= // more mailComponent.set(...)
= try = {
= ERMailDeliveryHTML message =3D 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 =3D "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_CON= TAINER_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---





Markus = Ruggiero


rucotec GmbH              =           web https://rucotec.ch
Steinenvorstadt 79          =       email markus.ruggiero@rucotec.ch
4051 Basel / = Switzerland         mobile +41 79 508 4701








= --Apple-Mail=_B55F6D56-D7FD-4F76-8EA1-818FF3425775-- --Apple-Mail=_C39EFE5F-2221-4CA2-91EB-40294CA56A43 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7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