XPages name picker not working with apostrophes

54 Views Asked by At

Strange issue, I'm using the extlib name picker, looking up a view of names (we don't use a NAB), which can be searched, a name selected and then added. This all works fine. EXCEPT, if a user has an apostrophe in their name. The search works, the name shows, but when you click Add, it simply doesn't do anything, and this is for ANY name with an apostrophe. Has anyone encountered this or know how to get around it? Any help greatly appreciated as there are no errors, or anything written to the console logs or online articles I can find describing it. Thanks Code below:

<xp:inputText id="lstPELName" value="#{document1.PELName}"
        maxlength="0" style="display: none;">
        
        <xp:eventHandler event="onchange" submit="true"
            refreshMode="partial" refreshId="refreshResponse">
            <xp:this.action><![CDATA[#{javascript:try{
document1.save();
// Set People Leader details
var agent:NotesAgent = database.getAgent("SetPELDetails");
agent.runWithDocumentContext(currentDocument.getDocument());

}catch(e){
    openLogBean.addError(e,this.getParent());
}}]]></xp:this.action>
        </xp:eventHandler>

    </xp:inputText>
        

<div class="col-xs-3 no-border" id="divPELPicker">      
    <xe:namePicker id="approversNamePicker" for="lstPELName">
        <xe:this.dataProvider>
            <xe:dominoViewNamePicker databaseName="ppg\dpi.nsf"
                viewName="CurrentProfilesByOwner" labelColumn="SystemName">
            </xe:dominoViewNamePicker>
        </xe:this.dataProvider>
        
        <xe:this.pickerText><![CDATA[#{javascript:"Select your People Leader:";
}]]></xe:this.pickerText>
    </xe:namePicker>
    </div>
<div class="col-xs-9 no-border" id="divPELName">
<xp:text escape="true" id="cmpPELName"
                        value="#{document1.PELName}">
                    </xp:text>
</div>
1

There are 1 best solutions below

2
D.Bugger On

I assume somewhere a character conversion is missing, probably to JSON. Can you modify the column in the view, and replace an apostrophe by its Unicode equivalent? That would be \u0027. You might have to escape the \ to make it work, as \\ or even \\\\.