Link to home
Start Free TrialLog in
Avatar of Vladimir Komarov
Vladimir Komarov

asked on

RefreshHideFormulas in javaScript (Lotus Notes) Is it exist?

Hi, i'm doing button with JS in Client Lotus Form that making some changes. After that, i want to refresh hide formulas to hide some fields, like  uidoc.refreshhideformulas in LotusScript. But i cannot find a method or function or something to do this job, any thoughts?
For example my code, it needs only onw string to be complete.

e = window.document.forms[0].elements
var  count = String(e.elements["countrow"].value)
for (j = 1, t=j+1 ; j < 49; j++,t++) {
e.elements[ "textlink"+j].value = e.elements[ "textlink"+t].value
e.elements[ "pwname"+j].value = e.elements[ "pwname"+t].value
e.elements[ "idn"+j].value = e.elements[ "idn"+t].value
}
e.elements[ "countrow"].value = count-1
???
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Hmmm... I have to confess that I rarely use JS in the Notes client. I never needed it, LotusScript usually lets me do what I want.

In this case I'd do the same: write some LotusScript code (almost identical to your JS code) and everything should work.
Your code rewritten in LS:

Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Dim count As Integer
Dim j As Integer, t As Integer

Set doc= ws.CurrentDocument.Document
count = CInt(doc.getItemValue("countrow")(0))
For j = 1 To 48
    t= j + 1
    Call doc.ReplaceItemValue("textlink" & j, doc.GetItemValue("textlink" & t))
    Call doc.ReplaceItemValue("pwname" & j, doc.GetItemValue("pwname" & t))
    Call doc.ReplaceItemValue("idn" & j, doc.GetItemValue("idn" & t))
Next
Call doc.ReplaceItemValue("countrow", count-1)

Open in new window

Avatar of Vladimir Komarov
Vladimir Komarov

ASKER

Thanks, but i don't need it in LotusScript, truth is - i rewrite LotusScript code into JS by myself, so my question remains open.
I don't understand... is this an academic question? Do you want it to work, or are you trying to do everything in JS as an exercise? AFAIK these methods or functions have not been implemented in Notes JS, so I think that what you want to do is impossible. Sorry.
Well, Lotus has very ugly buttons with minimum options, background color, font and his option, that's all. I've decided to make picture button with animation when you point mouse on it, i did hotspot but it can only work with JS on click, everything is almost done, looks cool but i still need that refresh to complete my work, cause my form has design element that should be hidden when i click on my JS button :(
Okay, I understand... Two ideas:
- maybe it's possible to trigger some other, invisible button written in LS from the first button that's written in JS
- in order to hide something on the client side, you can also change the style of the element you need to hide, or add a class with a style.
Any progress?
In progress, our best programer started to dig it up, turns out its very complicated, something betwen Java, JavaScript and Lotus Factroy methods, i'll write down it here when something comes up.
I'd appreciate that.

But, I'm wondering: why spend a lot of time, energy and money to do something that's so easy in LotusScript? It's not very pragmatic... Will the world be a better place? Will you win a Nobel prize? Is it the right thing to do?

After all, Domino 10 will be based on node.js, so things might be completely different then.
> why spend a lot of time, energy and money to do something that's so easy in LotusScript?
Because we can =)
Well, actually i told him that its not necessary now, but curiousity has prevailed, so now i'm interested in result too.
One of the best reasons: it's fun! Now I'm really interested in the result!
Hi... in the end, did you manage to refresh hides from JavaScript?
No, we had throw it away, now we're going to migrate from Lotus Notes, not because of that incident, but still. I'm slightly regret about our head's decision.
That's sad... Domino 10 is about to come out, you could migrate to XPages so you can give your applications a facelift without losing your databases, you could... Oh, well, I suppose it's a political decision.

I wonder where you want to migrate to? ScarePoint?? You don't have to answer that question! :-)

Good luck!
It would be nice for me to stay on Lotus or some other western platform, but who i am to make this decisions?)
We're about to start all business-process's on huge local ERP called "1C".
Just asking: question answered? Please close it!
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.