djextListTextBox onChange依赖控件

时间:2012-07-11 13:04:30

标签: xpages

我在修改djextListTextBox的更改事件后刷新依赖控件时出现问题。

这是一段代码片段:

...
<xe:djextListTextBox id="reinsuranceIdentifier" 
    value="#{offerAccount.reinsuranceIdentifier}" multipleSeparator=","
    multipleTrim="true" displayLabel="true">
    <xp:eventHandler event="onChange" submit="false">
        <xp:this.script><![CDATA[alert("reinsuranceIdentifier - onChange");
            XSP.partialRefreshGet("#{id:computedField1}", {});]]></xp:this.script>
    </xp:eventHandler>
</xe:djextListTextBox>
...
<xe:valuePicker id="valuePickerReinsuranceIdentifier"
    for="reinsuranceIdentifier" dialogTitle="Reinsurance"
    pickerIcon="/dropdown_16x16.gif">
    <xe:this.dataProvider>
        <xe:simpleValuePicker labelSeparator="|">
            <xe:this.valueList><![CDATA[#{javascript:var key = "Reinsurance_" + sessionScope.language;
                return getMultiParams(key, 4, true, true);}]]></xe:this.valueList>
        </xe:simpleValuePicker>
    </xe:this.dataProvider>
</xe:valuePicker>
...
<xp:text escape="true" id="computedField1">
    <xp:this.value><![CDATA[#{javascript:return "v: " + getComponent("reinsuranceIdentifier").getValue() + " -" + offerAccount.getItemValue("reinsuranceIdentifier") + " -" + offerAccount.getItemValue("reinsuranceIdentifier").get(0);}]]></xp:this.value>
</xp:text>
...

计算字段在刷新后显示以下值:     v: - [] -

指示“reinsuranceIdentifier”listTextBox的组件值和数据源项值都为空....

出了什么问题?

我需要根据列表文本框的值更改其他字段,这是不可能的?

由于 马里奥

1 个答案:

答案 0 :(得分:0)

您没有在onchange中提交,因此数据源将没有值。我不确定你的问题究竟是什么(我没有你的数据等很难说)但下面的代码是一个修改,它对我来说很好。尝试以这种方式进行部分刷新,除非你需要这样做以进行多个控制?

    <xe:djextListTextBox id="reinsuranceIdentifier" 
        value="" multipleSeparator=","
        multipleTrim="true" displayLabel="true">
        <xp:eventHandler event="onChange" submit="true"
            refreshMode="partial" refreshId="computedField1">
        </xp:eventHandler>
    </xe:djextListTextBox>

    <xp:br></xp:br>
    <xp:br></xp:br>

    <xe:valuePicker id="valuePickerReinsuranceIdentifier"
        for="reinsuranceIdentifier" dialogTitle="Reinsurance">
        <xe:this.dataProvider>
            <xe:simpleValuePicker valueListSeparator=",">
                <xe:this.valueList><![CDATA[#{javascript:
                    return "test1, test2, test3, test4";
                }]]></xe:this.valueList>
            </xe:simpleValuePicker>
        </xe:this.dataProvider>
    </xe:valuePicker>

    <xp:br></xp:br>
    <xp:br></xp:br>

    <xp:text escape="true" id="computedField1">
        <xp:this.value><![CDATA[#{javascript:return "v: " + getComponent("reinsuranceIdentifier").getValue();}]]></xp:this.value>
    </xp:text>