Announcement

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

    RadioGroupItem: toggle between different valueMaps

    SmartClient Version: v12.0p_2018-05-26/AllModules Development Only (built 2018-05-26)

    Chrome on OSX

    Please try sample in the showcase:

    Code:
    isc.VLayout.create({
        height: 600,
        width: 600,
        align: "center",
        defaultLayoutAlign: "center",
        members: [
            isc.DynamicForm.create({
                ID: "testForm",
                autoFocus: true,
                items: [
                    {
                        type: "text",
                        name: "test",
                        selectOnFocus: true,
                        value: 1,
                        valueMap: {1: "Yes", 2: "No"},
                        standardValueMap: {1: "Yes", 2: "No"},
                        customValueMap: {1: "foo", 2: "bar"},
                        showsStandard: true,
                        wrapTitle: false,
                        editorType: "RadioGroupItem"
                    }
                ]
            }),
            isc.Button.create({
                title: "Switch",
                autoFit: true,
                click: function () {
                    var myField = testForm.getField("test");
                    var value = myField.getValue();
                    if (myField.showsStandard) {
                        myField.setValueMap(myField.customValueMap);
                    } else {
                        myField.setValueMap(myField.standardValueMap);
                    }
                    myField.showsStandard = !myField.showsStandard;
                    myField.setValue(value);
                    return true;
                }
            })
        ]
    });
    The 'Switch' button toggles the 'test' form item between two different value maps. You may notice that after the first click, the value isn't set. Only in the next clicks it appears to work correctly.

    #2
    We'll take a look and update here when it's been fixed

    Comment


      #3
      Apologies for our delay in following up on this one - we neglected to update the thread, but we actually made some changes to address this a while back in 12.0, so you can retest in any recent build.

      Comment

      Working...
      X