Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem when entering new numeric values in combox items.

    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:
    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"
          }
         ]
        }
    );
    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

    #2
    This is a pseudo-feature. In some applications users know internal IDs and prefer to type those as a shortcut. Unfortunately, there isn't currently a way to turn this off if it's happening by accident.

    If possible, we'd recommend using ids that the user can't accidentally type, eg adding a "_" prefix or similar that is stripped off before save.

    Comment


      #3
      Thank you for the answer.

      The underliner workaround should work. But yes, a switch for disabling the detecting of the valeuMap keys would be nice.

      Comment

      Working...
      X