问题
i've a problem refreshing dependent controls after a change event of a djextListTextBox.
Here is a code fragment:
...
<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>
...
The computed field displays the following value after the refresh: v: -[] -
Indicating that both the component value and the datasource item value of the "reinsuranceIdentifier" listTextBox is empty....
What's going wrong??
I need to change other fields depending on the value(s) of the list text box, is this impossible?
Thanks Mario
回答1:
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>
来源:https://stackoverflow.com/questions/11433315/djextlisttextbox-onchange-dependent-controls