1

In Lotus Notes there is a simple way to access the directory from where to select some persons /users from a names field: ( this field is having Use Address dialog for choices for Choices )

enter image description here

I create a <xe:namePicker> to open the ( local ) names.nsf from where I can select/add some users:

    <xe:namePicker id="namePicker1" for="djTextarea5">
            <xe:this.dataProvider>
                                <xe:dominoNABNamePicker groups="false"
                                    nameList="peopleByLastName" addressBookDb="names.nsf"
                                    addressBookSel="db-name">
                                </xe:dominoNABNamePicker>
            </xe:this.dataProvider>
   </xe:namePicker>

Is there any chance I can choose from this xe:namePicker the above Lotus Notes places/directories as well in XPages? Thanks for your time.

Florin M.
  • 2,159
  • 4
  • 39
  • 97

1 Answers1

2

Use the xe:namePickerAggregator to add your address books to a list shown as drop down list in name picker:

enter image description here

<xe:namePicker id="namePicker1" for="djTextarea5">
    <xe:this.dataProvider>
        <xe:namePickerAggregator>
            <xe:this.dataProviders>
                <xe:dominoNABNamePicker groups="false"
                    nameList="peopleByLastName" addressBookDb="names.nsf"
                    addressBookSel="db-name">
                </xe:dominoNABNamePicker>
                <xe:dominoNABNamePicker groups="false"
                    nameList="peopleByLastName" addressBookDb="namesOther.nsf"
                    addressBookSel="db-name">
                </xe:dominoNABNamePicker>
                ...
            </xe:this.dataProviders>
        </xe:namePickerAggregator>
    </xe:this.dataProvider>
</xe:namePicker>
Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • Thanks for your response. I'm using this dataPicker inside a . Should I declared it somewhere? I'm getting the error: It is not defined on tag xp:td. – Florin M. Jul 29 '14 at 07:19
  • You should use it inside your namePicker. – Knut Herrmann Jul 29 '14 at 07:24
  • Thanks. It seems it works, but for the moment I can verify it.. I tried to put a .nsf from other server and it gives me this error: Unable to open database. This server is like this: nameServer/Company ... – Florin M. Jul 29 '14 at 07:30
  • For test: create on your server a copy of your company's address book and give it a different title. Server and database path should always be separated by `!!`. – Knut Herrmann Jul 29 '14 at 07:34
  • Both databases are names.nsf, one it is locally and the other one is on the above described server. I did tried addressBookDb="nameServer/Company!!names.nsf" but still it gives me the error .... – Florin M. Jul 29 '14 at 07:37
  • That should work. Probably, your server has no access to the other server. Are they trusted servers? – Knut Herrmann Jul 29 '14 at 07:41
  • my app is XPiNC. And in NC it works OK, the only problem is when I run it on browser... I think there are some administration settings for the server. – Florin M. Jul 29 '14 at 07:42
  • Don't forget too, that you don't have access to your local address book in browser as code is executed on server. – Knut Herrmann Jul 29 '14 at 07:50
  • So , I am accessing the local address book? – Florin M. Jul 29 '14 at 07:52
  • I can access the above names.nsf. The error shows when I try to access other names.nsf from other server. – Florin M. Jul 29 '14 at 07:53
  • You get with `addressBookDb="names.nsf"` the database from server if you are accessing from browser. – Knut Herrmann Jul 29 '14 at 07:55
  • And I suppose addressBookDb="names.nsf" is different than the addressBookDb="nameServer/Company!!names.nsf" – Florin M. Jul 29 '14 at 07:56
  • 1
    Yes, the latter accesses always server's names.nsf no matter if you are on XPiNC or browser. – Knut Herrmann Jul 29 '14 at 07:57
  • I see. Thanks for your explanations. I will talk with our admin regarding the trusted servers, between the 2 servers, as you said. – Florin M. Jul 29 '14 at 07:59
  • One more issue: So let say I want every user which is logged on, and access this namePicker, to access his ( personal ) address book ( + the company address book )? This isn't possible because the code is executed on server? – Florin M. Jul 29 '14 at 08:05
  • 1
    Access to personal address book is only possible for XPiNC. You'd need a copy of personal address book on server for browser access. There is a way to integrate it in user's mail database for iNotes but I don't know if it's possible to use it in this case. – Knut Herrmann Jul 29 '14 at 08:15
  • My app is XPiNC, runs both on Client and Web. – Florin M. Jul 29 '14 at 08:23
  • XPiNC = **XPages in Notes Client** means that it doesn't run on Web(-browser) but in Notes client (= local, **not** on server). You can run an application in XPiNC (= local) *and* browser (= on server). – Knut Herrmann Jul 29 '14 at 12:18