Calling all Javascript gurus! I’m VERY stuck on a Javascript problem, I’ve spent days on it and just can’t get it to work.
I need to do the following.
I have two fields, SelectGroup and Members. SelectGroup is a picklist which lists the groups in an application’s ACL. And Members field needs return a list of Members of the selected group as detailed in the Domino Directory. It’s a simple @DbLookup to the ($Groups) view in Notes Formula language, which works easily in the Notes client. But I just can’t get it to work on the web. My limitation is that I CANNOT use Refresh Fields on keyword change or Refresh Choices on document refresh for SelectGroup on the web due to some other code there.
Can anyone help me with some Javascript code to populate the Members field on the Web? I would be very grateful if someone could point me in the right direction.
Subject: @DbLookup to Domino Directory and Javascript
I’m NOT a javascript expert, this knowledge is based on an application a co-worker developed and then I took this and developed my own using the same principles. (So there maybe other approaches / better ideas)
As we all know when a browser client gets a web page the content (HTML) is downloaded and displayed on the browser. I belive the problem you’re having is you want the web page to change when people change the values selected. To do this you will need to “download” all possible cases and have your web page change based on their selection via the Javascript code.
You will need to set-up some javascript arrays holding your data. If you case you want:
arrays[“Group1”] = “member1member2…memberN”
arrays[“Group2”] = “membermember…member”
arrays[“Group3”] = “membermember…member”
…
arrays[“GroupM”] = “membermember…member”
Rather than “hard code this” we use an embedded view on the form than generates this list in the Javascript section.
Then in your group picklist, you want an “onClick=setValues()” that will execute when the value is chaged.
The function then looks as simple as this, but you will need findObj (you should find that if you google)
function setValues() {
var theString;
if ( theGroupItem=findObj('Group'))!=null ) {
theString = arrays[ theGroupItem.options[ theGroupItem.selectedIndex ].text ];
document.forms[0].Members.value=theString;
}
};
I know there are a lot of gaps in the above information, but hopefully it will give you some ideas on how to proceed as you probably have more Javascript Knowledge than I.