2
votes

I have a text field with type-ahead enabled. This field should accept multiple entries separated with semi-colon.

The field on the form bound is an Edit field with accept multiple values.

When saving the Xpage the value saved have an extra empty entry inserted at the end.

This is crucial error since the field is a Reader Names field and this enables the document readable to everyone instead of only to those groups taht is entered.

This is my field in the Xpage:

<xp:inputText id="inputText1" value="#{document1.docReaders}" multipleSeparator=";" multipleTrim="true" style="width:300px">
    <xp:this.attrs>
        <xp:attr name="placeHolder" value="Enter values, separate with semi-colon">
        </xp:attr>
    </xp:this.attrs>
    <xp:typeAhead mode="full" minChars="2" var="lookupKey" valueListSeparator=";" tokens=";" ignoreCase="true">
        <xp:this.valueList><![CDATA[#{javascript:var members = new tradesec.TCGroupUI().getMembers().sort();
return members;
}]]></xp:this.valueList>
    </xp:typeAhead>
</xp:inputText>

Values returned are displayed in the type-ahead drop down and when selecting one, the value is passed to the field with a semi-colon at the end; "MLI;"

Looking in the document it is stored with "MLI" and a "".

If I enter more than one entry the values are stored also and with an extra empty entry.

Using Domino 9 with latest patches. Please advice!

1
I assume you use ComputeWithForm=True to make it Readers. What about @ Trim as input translation/value of the field in form design?Frantisek Kossuth
No I don't use any QS-code to translate the values. The field is Editable and of type Reader NamesMikael Andersson Wigander
I didn't mention QS code. Seems you do use compute with form. Use Input translation formula then.Frantisek Kossuth
@MikaelGrevsten, did you find a solution to this?Per Henrik Lausten
I do have computeWithForm="onsave" and we don't have any code in the Form input/validation due to policy. So I found the easiest way to just trim the field in QuerySave event…Mikael Andersson Wigander

1 Answers

1
votes

I normally use the Dojo Text Area control and use newline as seperator. I do not experience issues with empty entries at the end. Here's an example:

<xe:djTextarea id="multiField" value="#{document.multiField}" multipleTrim="true">
    <xp:this.multipleSeparator><![CDATA[#{javascript:"\n"}]]></xp:this.multipleSeparator>
</xe:djTextarea>