Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Inconsistent behaviour changed on TimeItem with useTextField false

$
0
0
The changed handler is called for a TimeItem with pickItems when setting values on the form, this is inconsistent with the default formItem behaviour. To see this behaviour paste this code in the demo environment:
http://www.smartclient.com/docs/10.0/a/system/reference/SmartClient_Explorer.html#timeItem
Code:

isc.VLayout.create({
members:[isc.DynamicForm.create({
    debugMsg: function(form,item){
      var debugItem = this.getItem('debugText');
      var message = debugItem.getValue();
      if(!message){
        message = item.name + 'changed'
      }
      else{
          message = message + '\n' + item.name + 'changed'
      }
      debugItem.setValue(message);
    },
    ID: "debugForm",
    wrapItemTitles: false,
    fields: [
      {name: "debugText",type:'textArea',width:300,height:200}
    ]
}),
isc.DynamicForm.create({
    ID: "timeForm",
    wrapItemTitles: false,
    fields: [
      {name: "foo",type:'text',changed:function(form,item){debugForm.debugMsg(form,item);}},
      {name: "textTime", title: "Time #1", type: "time",changed:function(form,item){debugForm.debugMsg(form,item);}}, 
      {name: "pickTime", title: "Time #2", type:"time",changed:function(form,item){debugForm.debugMsg(form,item);},minuteIncrement: 15,useTextField: false}   
    ]
}),
isc.Button.create({
    left: 300,
    width: 125,
    title: "Click to test",
    click: function () {
        timeForm.setValues({foo:'bar',textTime:'10:00:00',pickTime:'12:00:00'});
    }
})]
})


Viewing all articles
Browse latest Browse all 4756

Trending Articles