Select problem

Hi,

I tried the below example online. (http://www.smartclient.com/index.jsp#selectItem)

I added two new options
“ABC” : “DEF”
“DEF” : “GHI”
and added an onchange event.

When I select option DEF, I get an alert “ABC”. When I select GHI, I do not get an alert. This indicates that both “GHI” and “DEF” have the same value which is “ABC”. You can confirm this by selecting some other option other that the said two and then select GHI. We get the alert “ABC”.

This appears to be a bug. Please let me know how to go about fixing this.

We use version I somorphic version 5.6.

isc.DynamicForm.create({
width: 500,
fields: [{
name: “shipTo”, title: “Ship to”, type: “select”,change:“alert(value)”,
hint: “<nobr>Overnight shipping available for countries in bold</nobr>”,
valueMap: {
“US” : “<b>United States</b>”,
“CH” : “China”,
“JA” : “<b>Japan</b>”,
“IN” : “India”,
“GM” : “Germany”,
“FR” : “France”,
“IT” : “Italy”,
“RS” : “Russia”,
“BR” : “<b>Brazil</b>”,
“CA” : “Canada”,
“MX” : “Mexico”,
“SP” : “Spain”,
“ABC” : “DEF”,
“DEF” : “GHI”
},
imageURLPrefix:“flags/16/”,
imageURLSuffix:“.png”,
valueIcons: {
“US” : “US”,
“CH” : “CH”,
“JA” : “JA”,
“IN” : “IN”,
“GM” : “GM”,
“FR” : “FR”,
“IT” : “IT”,
“RS” : “RS”,
“BR” : “BR”,
“CA” : “CA”,
“MX” : “MX”,
“SP” : “SP”
}
}]
});

That’s not a very plausible bug for a system like SmartClient to have :slight_smile:

Your problem is that 1) by not returning true from change() you cancel changes 2) you should not use alert() for debugging, as it can reorder events, use isc.Log.logWarn() and related methods instead, as discussed in the Debugging topic.

But, how come all other selections except the mentioned options below gives correct values in the alert ? Why is that only
the below two options aren’t correct ? By selecting option GHI, why is the value taken as ABC ? Shouldn’t it be alerting DEF ? Is it because the key of one option is a value in the other ?

“ABC” : “DEF”
“DEF” : “GHI”

Removing alerts and returning true is not solving the problem. :frowning:

I would be more than glad if I can hear any updates on this.

Thanks.

Am I going wrong somewhere ? or is this an issue ? Is there any workaround ? or Should I go ahead and make changes to my code to handle this ?

Its really very urgent. please let me know