Hi everyone!
The problem is: how to refresh/reload a document
through JS/Common JS, so I can see form changes through the web?
Thanks in advance,
Dmitry.
Hi everyone!
The problem is: how to refresh/reload a document
through JS/Common JS, so I can see form changes through the web?
Thanks in advance,
Dmitry.
Subject: RE : Refreshing a document in (Common) Javascript
Maybe : window.location.reload( true )
Subject: RE: RE : Refreshing a document in (Common) Javascript
That does not refresh, as such – it reloads the page as it was before any changes were made. To refresh, use a formula action:
@Command([ViewRefreshFields])
with or without a FIleSave. It is possible to call that formula action from JavaScript, but the formula action must appear on the form and (unless you wantto recode the JS constantly) should be available on the web even if it is hidden in HTML.
Subject: RE: RE : Refreshing a document in (Common) Javascript
I have the refresh logic working fine on the web (using either a click() invocation on the button or the _DoClick(…) call) but I can’t figure out how to do this on the ND6 client. Even with a name=“RefreshButton” parameter added to the hotspot button, Common JavaScript says that the form.RefreshButton object has no properties.
What am I missing?
Subject: RE: RE : Refreshing a document in (Common) Javascript
Would you mind posting your actual code?
Subject: RE: RE : Refreshing a document in (Common) Javascript
I am experimenting with “webifying” an existing Notes client only workflow app using R6.5.1
The following JS code in an Action is used to change the status of a request document without saving it; that is, it validates that the status change is OK and then changes the status field and does a refresh.
WEB JS
var f = document.forms[0];
var msg = okForStatus(f, “Locked”);
if (msg != “”) {
alert(“Lock aborted for the following reason(s):\n\n” + msg);
return false;
}
f.status.value = “Locked”;
_doClick(‘$Refresh’, this,‘_self’, ‘’);
This works just fine in the browser (IE6). Because I don’t want to have to duplicate the validation logic (okForStatus) in LotusScript, I’d like to use JS in the Notes Client as well. The following was created after an attempt to use Common JavaScript informed me that the Notes Client doesn’t have _doClick defined.
CLIENT JS
var f = document.forms[0];
var msg = okForStatus(f, “Locked”);
if (msg != “”) {
alert(“Lock aborted for the following reason(s):\n\n” + msg);
} else {
f.status.value = “Locked”;
f.RefreshButton.click();
}
(The logic flow is different because the Notes Client complained about the return statement. I also previously tried to use getElementById but it, as expected, is not understood by the Notes Client.) The above JS in the Notes Client does the validation OK but then fails with the JavaScript error “ToObjectError: f.RefreshButton has no properties”.
The RefreshButton is a hotspot button defined for the Client only. It contains the formula
@Command([RefreshHideFormulas]);@Command([ViewRefreshFields])
and has the following set in the HTML tab of its properties
ID RefreshButton
Other name=“RefreshButton”
Again, the issue here is not having to duplicate logic between JavaScript and LotusScript so I’d really like to be able to do the “update status and refresh” in JS in both the Web and the Client.