Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28th Apr 2010, 07:25
gli gli is offline
Registered Developer
 
Join Date: Mar 2008
Posts: 57
Default ComboBoxItem PickList selection question

Hello,

I have a question regarding a ComboBoxItem.
Here is the example :
Code:
isc.setAutoDraw(true);
isc.DynamicForm.create ({
	fields: [
		{ name: "myField", type: "enum", editorType: "comboBox", valueMap: {"100": "NO", "200": "NOT", "2300": "NOTHING"},
			changed: function (form, item, value) {
				isc.logWarn ("changed = " + value);
			}
		}
	]
});
I need to launch an event when the user choses an option in the "PickList" and the "PickList" is hidden.

If I enter "N" then O" for "NO", I get two log messages "changed" with the first one value = "N", and the second value = "100" (the value is being converted to the value of the "key" in the "key-name" pair of the "ValueMap")
but I need to launch an event when I have a new value selected in the list and not when the text is changed in the ComboBox even if the text is in the valueMap.
(The user maybe searching for "NOT" or "NOTHING")

In the following example, even if the user enters "NO" to search for text, I need to launch an event when the "NO" option is selected in the "PickList" and the "PickList" is closed.
I cannot use the "changed" event since it is not being launched when I click on the "NO" option.

Is there a function or an event that is launched when the user picks a value in the "PickList" ? Can it be overriden ?
Or is there a way to prevent the value from being converted to the key in the "valueMap" ? (The value in the "changed" event remains equal to the "name" value and not the "key" value until the user selects the item from the "PickList")

Thank you
Reply With Quote
  #2  
Old 28th Apr 2010, 09:47
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,520
Default

Some enhancements are planned in this area, however right now, the way to disambiguate whether a click was on the picklist or not would be to switch to populating the ComboBox with an optionDataSource (can be clientOnly) and use getSelectedRecord() from changed() to see if the user unambiguously chose a record.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved