0

我在 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的组件值和数据源项值都是空的......

怎么了??

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

谢谢马里奥

4

1 回答 1

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>
于 2012-07-11T13:32:59.870 回答