Announcement

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

    TimeItem with canEdit: false and valuesHaveChanged inconsistencies

    Hi,
    I have a code snippet that creates a DynamicForm, with a TimeItem inside. And a ValuesManager to manage the DynamicForm. Below, there is a button that, when clicked, prints on the console the result of calling vm.valuesHaveChanged(). If I set the TimeItem canEdit property to false, the result of ValuesManager.valuesHaveChanged becomes inconsistent. It works ok with canEdit: true.
    The code snippet is the following:

    Code:
    var form = isc.DynamicForm.create({
       fields: [
          {name: "time", type: "time", canEdit: false}
       ]
    });
    
    var vm = isc.ValuesManager.create({
       members: [form]
    });
    
    var button = isc.Button.create({
       title: "Button",
       action: function() {
          console.log("valuesHaveChanged: " + vm.valuesHaveChanged());
       }
    });
    
    form.setValue("time", new Date(1970, 0, 1, 11, 30, 0, 0));
    vm.rememberValues();
    
    isc.VLayout.create({
       width: 100,
       members: [form, button]
    });
    In order to reproduce my problem follow these steps:
    1- Click "Button" and check the console output. You will see that it prints 'valuesHaveChanged: false', meaning that the values have not changed.
    2- Then double click on the time item. You cannot edit the value, and hence the value does not change. Click "Button" again. Now it prints 'valuesHaveChanged: true', but the values have not changed.

    If you set canEdit: true in the TimeItem, the result of vm.valuesHaveChanged is as expected.

    Browser: Google Chrome Version 47.0.2526.80 m
    SmartClient Version v10.0p_2015-08-18 (2015-08-18)
    Last edited by felipe_1; 15 Dec 2015, 01:59.

    #2
    Please try this with the latest patched build (and please remember to always do this before reporting something as an issue).

    Comment


      #3
      I can reproduce it on v10.1p_2015-12-13.

      Comment

      Working...
      X