简体   繁体   中英

xe:djextListTextBox control displays wrong value for fields with similar aliases/synonyms

I recently discovered a problem with the xe:djextListTextBox control using xe:valuePicker for values that have synonyms/aliases. If the synonyms are similar between pickers that are bound to different fields, when selecting the value for the first field, selecting the matching value for the second field displays the text from the first selection.

For example, picker #1 has 3 values with aliases/synonyms: blue|1, green|2, yellow|3. Picker # 2 has 3 different values but the same synonyms: red|1, orange|2, purple|3.

If I select "blue" for picker # 1 it displays "blue." When I then select "red" for picker #2, instead of displaying "red", it displays "blue".

The good thing is that when the document is saved (the synonyms are saved correctly) and reopened in Read mode, the two fields properly display the correct values. The issue seems to be in Edit mode. Has anyone come across this before and aware of a fix?

Here is test code:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
    <xp:this.data>
        <xp:dominoDocument var="doc1" />
    </xp:this.data>

    <p>
        k1
        <xe:valuePicker for="k1" pickerText="add">
            <xe:this.dataProvider>
                <xe:simpleValuePicker valueList="blue|1;green|2;yellow|3" labelSeparator="|" valueListSeparator=";" />
            </xe:this.dataProvider>
        </xe:valuePicker>
    </p>
    <p>
        <xe:djextListTextBox id="k1" value="#{doc1.k1}"
            displayLabel="true" multipleSeparator=";" multipleTrim="true" />
    </p>

    <p>
        k2
        <xe:valuePicker for="k2" pickerText="add">
            <xe:this.dataProvider>
                <xe:simpleValuePicker valueList="red|1;orange|2;purple|3" labelSeparator="|" valueListSeparator=";" />
            </xe:this.dataProvider>
        </xe:valuePicker>
    </p>
    <p>
        <xe:djextListTextBox id="k2" value="#{doc1.k2}"
            displayLabel="true" multipleSeparator=";" multipleTrim="true" />
    </p>
</xp:view>

I ended up opening a ticket with HCL and their suggested workaround was to add an onChange event to the djextListTextBox to refresh its value. I'm not thrilled with it because I have a lot of fields and it's a performance hit, but it does work.

<xp:div id="refreshTarget">
    ...
    <p>
        <xe:djextListTextBox id="k1" value="#{doc1.k1}" style="font-size:smaller"
            displayLabel="true" multipleSeparator=";" multipleTrim="true">
            <xp:eventHandler event="onChange" submit="true" refreshMode="partial"
                refreshId="refreshTarget" />
        </xe:djextListTextBox>
    </p>
</xp:div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM