Javascript 如何设置标签&;使用客户端脚本的Dojo列表文本框的值

Javascript 如何设置标签&;使用客户端脚本的Dojo列表文本框的值,javascript,dojo,xpages,xpages-extlib,Javascript,Dojo,Xpages,Xpages Extlib,我可以使用下面的脚本设置“值” <xe:djextListTextBox id="inputText" value="#{document1.FormTitle}" displayLabel="true" multipleSeparator="##"></xe:djextListTextBox> <xp:button value="Set Value" id="b1"> <xp:eventHandler event="onclick" subm

我可以使用下面的脚本设置“值”

<xe:djextListTextBox id="inputText" value="#{document1.FormTitle}" displayLabel="true" multipleSeparator="##"></xe:djextListTextBox>

<xp:button value="Set Value" id="b1">
    <xp:eventHandler event="onclick" submit="false">
        <xp:this.script><![CDATA[var id = "#{id:inputText}";
        dijit.byId( id ).set( "value", "Value 1##Value 2" );        
        ]]></xp:this.script>
    </xp:eventHandler>
</xp:button>

但是我想做的是设置一个标签来显示,并且在背景中有另一个值。 基本上复制了下面显示的功能

<xe:djextListTextBox id="djextListTextBox14" multipleSeparator="," multipleTrim="true" defaultValue="1,3" value="#{document1.Test}"
    displayLabel="true" title="Multiple Values with labels">
</xe:djextListTextBox>
<xe:valuePicker id="valuePicker15" for="djextListTextBox14" pickerText="Add" dojoType="extlib.dijit.PickerListSearch">
    <xe:this.dataProvider>
        <xe:simpleValuePicker labelSeparator="|" valueList="Value1|1,Value2|2,Value3|3,Value4|4" valueListSeparator=","></xe:simpleValuePicker>
    </xe:this.dataProvider>
</xe:valuePicker>

您可以在客户端使用

dijit.byId(id).set("labels", {"value1":"label1","value2":"label2",...});
您的示例如下所示:

<xe:djextListTextBox id="inputText" value="#{document1.FormTitle}" 
      displayLabel="true" multipleSeparator="##">
</xe:djextListTextBox>
<xp:button value="Set Value" id="b1">
    <xp:eventHandler event="onclick" submit="false">
        <xp:this.script><![CDATA[
            var id = "#{id:inputText}";
            dijit.byId(id).set("labels", {"Value 1":"Label 1", "Value 2":"Label 2"});
            dijit.byId(id).set("value", "Value 1##Value 2");        
        ]]></xp:this.script>
    </xp:eventHandler>
</xp:button>


你能用“displayedValue”来做一个.set(“displayedValue”,“Value”)吗?那很好,但不幸的是没有(尝试过)。由于这是extLib提供的,我猜他们有一个扩展的方法,但我找不到它。它必须像…set一样工作(“Value1,Value2”,“Label2,Label2”)