Does anyone know how to serve up to the user a new Lotus Notes memo in edit mode from a dijit.form.Button on an xPage?
Similar to how it was previously done in formula language like this:
@Command([Compose]; @MailDbName; “Memo”):
@Command([EditInsertText];Emp_ContactEmail):
@Command([EditGotoField];“Subject”))
or in LotusScript like this:
Set uidoc = ws.EditDocument( True, MailDoc )
I can’t use the latter from an agent, because of the ui items, so I’ve been programming in JavaScript and have this:
I’ve also tried href = url; and
facesContext.getExternalContext().redirect(url)
and anything else I can think of, but no joy.
Thanks very much for any suggestions!
Subject: Part Way There
Ok, I’m part way there. I’ve found if I use:facesContext.getExternalContext().redirect(“notes://server/mail/filename.nsf/Memo?OpenForm”), I get what I need, however, if I go back to the original xPage, there is now a big blank page there. So I can’t have that as I want the user’s previous xPage to remain.
Back to the drawing board…
Subject: Combine SSJS & CSJS?
One option is pass your URL to a field on the XPage, do a partial refresh on an area that includes that field, and in your onComplete call window.open, passing in the mailto url. You may be able to do something similar by triggering a link or button in CSJS to trigger the mailto. See this blog about combining SSJS & CSJS サッカー ユニフォーム 安い – xpagesblog.com | 安いジャージを買う。 21.99 という安いジャージ。 ファンに最高のコレクションを提供します。 安心してお買い物をしてください。
Subject: Can’t Get This Working Yet
Sorry Paul, but I can’t seem to get this working.
I’m using your article and in the onComplete event, if I put an alert in front of the inputSSJS field, it is displayed, but if I use window.open I receive the error message: “Problem submitting an area of the page. Component returned failure code: 0x800004001 (NS_ERROR_NOT_IMPLEMENTED)[nsIDOMJSWindow.open] Submit the entire page?” And whether I select Ok or Cancel, nothing happens.
I’ve tried using just open, but get the same result. I’ve tried using both the mailto: url and the “notes://…” url, but the same result occurs. And if I just include the url itself, either with our without the .value, nothing happens - no error, nothing. So I’m at a loss about why the url isn’t invoked as a link.
When you said “you may be able to do something similar by triggering a link or button in CSJS to trigger the mailto”, how exactly would I do that?
This, I find, is where most of my problems lie with xPages - I don’t yet know what it wants, when something doesn’t work yet doesn’t throw an error.
If you could please give me a push in the right direction it would be much appreciated. Thanks!
Subject: I Figured It Out!
It just needed a small tweak. One I changed window.open to the following syntax, it all works wonderfully with the mailto url:xp:this.onComplete</xp:this.onComplete>
Thank you so much for your help with this Paul!