Hi, all.
I'm having a problem with SelectItems. In SmartClient version 8 [8.0/LGPL Deployment (built 2011-01-21)], SelectItems in a particular window would populate with default values as coded in the field definitions. A rememberValues call would be made after the window opens, and all was well. The "haveValuesChanged" function would report FALSE if the user has not yet edited items on the form.
AFTER upgrading to SmartClient 10, the "haveValuesChanged" function now reports TRUE after the window first opens even if the user has made no edits, and this appears to be due to the dropdowns taking on default values. I can prevent this behavior by commenting out the "defaultValue" line in the definition for the SelectItem field.
(Side note: I have attempted to force the SelectItem's value to the empty string default prior to the initial call to the form's "rememberValues" function. That does not work -- "haveValuesChanged" still returns TRUE. Commenting out the defaultValue does allow "haveValuesChanged" to return FALSE again. I'd like to use a better solution than to comment all defaultValue lines.)
Thanks for any ideas!
==============
*SmartClient:
SmartClient Version: v10.0p_2015-02-13/LGPL Deployment (built 2015-02-13)
*Browser:
Firefox 36.0.1:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0
*Code snippet:
{name: "STATE_FIPS",
title: "State/Province",
titleStyle: "formTitleRequired",
isProtected: true,
wrapTitle: false,
prompt: "State",
editorType: "SelectItem",
width: 150,
autoFetchData: true,
optionDataSource: isc.EASDataSources.EAS.states,
//after ISC10 upgrade, this default value causes a problem (triggers "valuesHaveChanged") .. disabling it now
defaultValue: "",
displayField: "STATE_LBL",
valueField: "STATE_VAL",
changed: function(form, item, value){
form.setValue("STATE_FIPS_DIS", value);
form.setValue("COUNTY_FIPS_DIS", null);
form.setValue("COUNTY_FIPS", null);
var criteria = {STATE_FIPS: value};
form.getField("COUNTY_FIPS").fetchData(criteria);
form.dirtyAddress();
return true;
},
validators: [{type: "requiredIfFormValidates"}]
},
I'm having a problem with SelectItems. In SmartClient version 8 [8.0/LGPL Deployment (built 2011-01-21)], SelectItems in a particular window would populate with default values as coded in the field definitions. A rememberValues call would be made after the window opens, and all was well. The "haveValuesChanged" function would report FALSE if the user has not yet edited items on the form.
AFTER upgrading to SmartClient 10, the "haveValuesChanged" function now reports TRUE after the window first opens even if the user has made no edits, and this appears to be due to the dropdowns taking on default values. I can prevent this behavior by commenting out the "defaultValue" line in the definition for the SelectItem field.
(Side note: I have attempted to force the SelectItem's value to the empty string default prior to the initial call to the form's "rememberValues" function. That does not work -- "haveValuesChanged" still returns TRUE. Commenting out the defaultValue does allow "haveValuesChanged" to return FALSE again. I'd like to use a better solution than to comment all defaultValue lines.)
Thanks for any ideas!
==============
*SmartClient:
SmartClient Version: v10.0p_2015-02-13/LGPL Deployment (built 2015-02-13)
*Browser:
Firefox 36.0.1:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0
*Code snippet:
{name: "STATE_FIPS",
title: "State/Province",
titleStyle: "formTitleRequired",
isProtected: true,
wrapTitle: false,
prompt: "State",
editorType: "SelectItem",
width: 150,
autoFetchData: true,
optionDataSource: isc.EASDataSources.EAS.states,
//after ISC10 upgrade, this default value causes a problem (triggers "valuesHaveChanged") .. disabling it now
defaultValue: "",
displayField: "STATE_LBL",
valueField: "STATE_VAL",
changed: function(form, item, value){
form.setValue("STATE_FIPS_DIS", value);
form.setValue("COUNTY_FIPS_DIS", null);
form.setValue("COUNTY_FIPS", null);
var criteria = {STATE_FIPS: value};
form.getField("COUNTY_FIPS").fetchData(criteria);
form.dirtyAddress();
return true;
},
validators: [{type: "requiredIfFormValidates"}]
},