Hello,
I need a combox where the user has the option to either chose a given selection, or entering a new value. I have created the following combox:
This works well, For example choosing an Apple and pressing the "Show fruits" button results in Display value: “Apple”, and value 2. Also entering a new value works well, for example typing in “Papaya “ result in Display value: “Papaya”, and value “Papaya”.
But when I enter a number, that is also a key of the value map, I´m getting the corresponding object of the value map. For example typing in new value of “1”, results in Display value: “Banana”, and value 1.
What can I do in order to get the typed in “1” in the same manner as “Papaya”? Means Display value: “1”, and value “1”.
Greetings Thomas
I need a combox where the user has the option to either chose a given selection, or entering a new value. I have created the following combox:
Code:
isc.DynamicForm.create(
{
height:400,
width:500,
fields:
[
{
"editorType":"comboBox",
"valueMap":
{
1:"Banana",
2:"Apple",
3:"Strawberry"
},
"type":"text",
"ID":"fruitsComboBoxItem",
"title":"Fruits"
},
{
"type":"button",
"click":function (p1, p2) {isc.say("Display value:"+ fruitsComboBoxItem.getDisplayValue()+ ". Value:" + fruitsComboBoxItem.getValue()) },
"title":"Show fruits"
}
]
}
);
But when I enter a number, that is also a key of the value map, I´m getting the corresponding object of the value map. For example typing in new value of “1”, results in Display value: “Banana”, and value 1.
What can I do in order to get the typed in “1” in the same manner as “Papaya”? Means Display value: “1”, and value “1”.
Greetings Thomas
Comment