Search code examples
xpagesxpages-ssjsxpages-extlib

Xpages Extension library name picker shows SyntaxError: expected expression, got '< when clicked


ok so I got this issue that's been a big question mark to me, I'm currently using Notes version 9.0.1 both on server and designer. I created a custom control that has a field and a name picker next to it. I created a main xsp and put the custom control there. I did not change any setting in namepicker other than the provider which I set to dominoNAB... I leave the other settings as default. I ran the main xsp and clicked on the name picker but it throws a dialog box that says SyntaxError: expected expression, got '< , the namepicker is blank and there's nothing in the notes log. Does someone experienced this? Thank you in advance for the help.

Update: This is the exact code of my namepicker

 <xp:inputText
                                value="#{accountDocument.AcctMngr}" id="acctMngr1"
                                style="width:267.0px" showReadonlyAsDisabled="true">
                            </xp:inputText>
                            <xe:namePicker id="namePicker1"
                                for="acctMngr1" dialogTitle="Account Manager">
                                <xe:this.dataProvider>
                                    <xe:dominoNABNamePicker
                                        addressBookSel="all-public" nameList="peopleByLastName">
                                    </xe:dominoNABNamePicker>
                                </xe:this.dataProvider>
                            </xe:namePicker></xp:td>

This is the error that shows when I click the namepicker's icon.

Error thrown when namepicker is clicked

I used firebug to check the error and this is what I saw.

Firebug error


Solution

  • Is the user logged in to the application, and do they have access to the NAB that is being accessed? I can reproduce the dialog you are seeing when trying to use the name picker as an Anonymous user. But everything works fine when logged in as a user with sufficient NAB access.

    Looking at the response from the server in Firebug, as Anonymous user it responds with the login page for the NAB. And this response can't be handled somewhere in the process of rendering the name picker. It's not a very helpful error though, it should really tell you that access is denied or something like that.

    As an addendum to that, you may be better off being more explicit about what NAB to use in your picker. Instead of the generic "all-public", use something like this for example:

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