djextListTextBox onChange 依赖控件 [英] djextListTextBox onChange dependent controls

查看:23
本文介绍了djextListTextBox onChange 依赖控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 djextListTextBox 的更改事件后刷新依赖控件时遇到问题.

i've a problem refreshing dependent controls after a change event of a 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: -[] -

The computed field displays the following value after the refresh: v: -[] -

表示reinsuranceIdentifier"listTextBox的组件值和datasource item值都为空....

Indicating that both the component value and the datasource item value of the "reinsuranceIdentifier" listTextBox is empty....

怎么了??

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

I need to change other fields depending on the value(s) of the list text box, is this impossible?

谢谢马里奥

推荐答案

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

You are not submitting in the onchange so the datasource will not have a value. I'm not sure exactly what your issue is ( I don't have your data etc so hard to tell ) but the below code is a modification and it works fine for me. try doing a partial refresh this way unless you need to do it that way to do multiple controls ?

    <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>

这篇关于djextListTextBox onChange 依赖控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆