Creating a new record with an invalid time value, there is no error indication on the form, and the record is not added.
The log indicates the value "8:00 xx" is rejected at the server.
This is true, even if a 'valid' value "8:00" is entered.
But, works when the value "08:00" is entered.
Form validation is done before saving. Here is the SAVE button code.
And, here is the form.
I am puzzled.
If the TimeItem validation fails on the server, why not at the client on the form, first?
Why does the server accept '08:00' as input, but not '8:00'?
Interesting, yes?
Rick
P.S. I am running SmartClient Version: v8.3p_2014-06-27/EVAL on Mozilla Firefox 20.0 with Firebug using Windows 7 Premium 64 bit.
The log indicates the value "8:00 xx" is rejected at the server.
=== 2014-08-15 19:18:48,468 [sor2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
values:{
DueReminderDate:new Date(1408060800000),
DueReminderTime:"8:00 xx",
CommunityID:101,
ProjectID:102,
TaskID:101,
StatusChangeOption:true,
AnyChangeOption:false,
DueReminderOption:false,
TeamMemberID:104
},
operationConfig:{
dataSource:"TaskSubscriber",
operationType:"add"
},
componentId:"TaskSubscriberForm",
appID:"builtinApplication",
operation:"TaskSubscriber_add",
oldValues:{
},
criteria:{
}
}
=== 2014-08-15 19:18:48,483 [sor2] INFO IDACall - Performing 1 operation(s)
=== 2014-08-15 19:18:48,483 [sor2] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2014-08-15 19:18:48,483 [sor2] DEBUG DeclarativeSecurity - DataSource TaskSubscriber is not in the pre-checked list, processing...
=== 2014-08-15 19:18:48,483 [sor2] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No userTypes defined, allowing anyone access to all operatio
ns for this application
=== 2014-08-15 19:18:48,483 [sor2] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No public zero-argument method named '_TaskSubscriber_add' f
ound, performing generic datasource operation
=== 2014-08-15 19:18:48,483 [sor2] DEBUG ValidationContext - [builtinApplication.TaskSubscriber_add] Adding validation errors at path '/TaskSubscriber/
DueReminderTime': {errorMessage=Must be a time.}
=== 2014-08-15 19:18:48,483 [sor2] INFO Validation - [builtinApplication.TaskSubscriber_add] Validation error: [
{
DueReminderTime:{
errorMessage:"Must be a time."
}
}
]
values:{
DueReminderDate:new Date(1408060800000),
DueReminderTime:"8:00 xx",
CommunityID:101,
ProjectID:102,
TaskID:101,
StatusChangeOption:true,
AnyChangeOption:false,
DueReminderOption:false,
TeamMemberID:104
},
operationConfig:{
dataSource:"TaskSubscriber",
operationType:"add"
},
componentId:"TaskSubscriberForm",
appID:"builtinApplication",
operation:"TaskSubscriber_add",
oldValues:{
},
criteria:{
}
}
=== 2014-08-15 19:18:48,483 [sor2] INFO IDACall - Performing 1 operation(s)
=== 2014-08-15 19:18:48,483 [sor2] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2014-08-15 19:18:48,483 [sor2] DEBUG DeclarativeSecurity - DataSource TaskSubscriber is not in the pre-checked list, processing...
=== 2014-08-15 19:18:48,483 [sor2] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No userTypes defined, allowing anyone access to all operatio
ns for this application
=== 2014-08-15 19:18:48,483 [sor2] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No public zero-argument method named '_TaskSubscriber_add' f
ound, performing generic datasource operation
=== 2014-08-15 19:18:48,483 [sor2] DEBUG ValidationContext - [builtinApplication.TaskSubscriber_add] Adding validation errors at path '/TaskSubscriber/
DueReminderTime': {errorMessage=Must be a time.}
=== 2014-08-15 19:18:48,483 [sor2] INFO Validation - [builtinApplication.TaskSubscriber_add] Validation error: [
{
DueReminderTime:{
errorMessage:"Must be a time."
}
}
]
=== 2014-08-15 19:22:12,953 [sor3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
values:{
DueReminderDate:new Date(1408060800000),
DueReminderTime:"08:00 AM",
CommunityID:101,
ProjectID:102,
TaskID:101,
StatusChangeOption:true,
AnyChangeOption:false,
DueReminderOption:false,
TeamMemberID:102
},
operationConfig:{
dataSource:"TaskSubscriber",
operationType:"add"
},
componentId:"TaskSubscriberForm",
appID:"builtinApplication",
operation:"TaskSubscriber_add",
oldValues:{
},
criteria:{
}
}
=== 2014-08-15 19:22:12,968 [sor3] INFO IDACall - Performing 1 operation(s)
=== 2014-08-15 19:22:12,969 [sor3] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2014-08-15 19:22:12,969 [sor3] DEBUG DeclarativeSecurity - DataSource TaskSubscriber is not in the pre-checked list, processing...
=== 2014-08-15 19:22:12,969 [sor3] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No userTypes defined, allowing anyone access to all operatio
ns for this application
=== 2014-08-15 19:22:12,969 [sor3] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No public zero-argument method named '_TaskSubscriber_add' f
ound, performing generic datasource operation
=== 2014-08-15 19:22:12,969 [sor3] DEBUG ValidationContext - [builtinApplication.TaskSubscriber_add] Adding validation errors at path '/TaskSubscriber/
DueReminderTime': {errorMessage=Must be a time.}
=== 2014-08-15 19:22:12,969 [sor3] INFO Validation - [builtinApplication.TaskSubscriber_add] Validation error: [
{
DueReminderTime:{
errorMessage:"Must be a time."
}
}
]
values:{
DueReminderDate:new Date(1408060800000),
DueReminderTime:"08:00 AM",
CommunityID:101,
ProjectID:102,
TaskID:101,
StatusChangeOption:true,
AnyChangeOption:false,
DueReminderOption:false,
TeamMemberID:102
},
operationConfig:{
dataSource:"TaskSubscriber",
operationType:"add"
},
componentId:"TaskSubscriberForm",
appID:"builtinApplication",
operation:"TaskSubscriber_add",
oldValues:{
},
criteria:{
}
}
=== 2014-08-15 19:22:12,968 [sor3] INFO IDACall - Performing 1 operation(s)
=== 2014-08-15 19:22:12,969 [sor3] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2014-08-15 19:22:12,969 [sor3] DEBUG DeclarativeSecurity - DataSource TaskSubscriber is not in the pre-checked list, processing...
=== 2014-08-15 19:22:12,969 [sor3] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No userTypes defined, allowing anyone access to all operatio
ns for this application
=== 2014-08-15 19:22:12,969 [sor3] DEBUG AppBase - [builtinApplication.TaskSubscriber_add] No public zero-argument method named '_TaskSubscriber_add' f
ound, performing generic datasource operation
=== 2014-08-15 19:22:12,969 [sor3] DEBUG ValidationContext - [builtinApplication.TaskSubscriber_add] Adding validation errors at path '/TaskSubscriber/
DueReminderTime': {errorMessage=Must be a time.}
=== 2014-08-15 19:22:12,969 [sor3] INFO Validation - [builtinApplication.TaskSubscriber_add] Validation error: [
{
DueReminderTime:{
errorMessage:"Must be a time."
}
}
]
=== 2014-08-15 19:24:01,842 [sor7] DEBUG RPCManager - Request #1 (DSRequest) payload: {
values:{
DueReminderDate:new Date(1408060800000),
DueReminderTime:new Date(28800000),
CommunityID:101,
ProjectID:102,
TaskID:101,
StatusChangeOption:true,
AnyChangeOption:false,
DueReminderOption:false,
TeamMemberID:102
},
operationConfig:{
dataSource:"TaskSubscriber",
operationType:"add"
},
componentId:"TaskSubscriberForm",
appID:"builtinApplication",
operation:"TaskSubscriber_add",
oldValues:{
},
criteria:{
}
}
values:{
DueReminderDate:new Date(1408060800000),
DueReminderTime:new Date(28800000),
CommunityID:101,
ProjectID:102,
TaskID:101,
StatusChangeOption:true,
AnyChangeOption:false,
DueReminderOption:false,
TeamMemberID:102
},
operationConfig:{
dataSource:"TaskSubscriber",
operationType:"add"
},
componentId:"TaskSubscriberForm",
appID:"builtinApplication",
operation:"TaskSubscriber_add",
oldValues:{
},
criteria:{
}
}
Code:
if (form.validate(false)) { // alert("validation succeeded."); /**/ form.saveData(); if (!form.hasErrors()) { oldValues = null; newValues = null; form.rememberValues(); form.newLogEntry = null; //form.setValue("Notes", null); form.getItem("SaveButton").setDisabled(true); form.getItem("UndoButton").setDisabled(true); form.changesPending = false; TaskSubscriberWindow.closeClick(); } else { alert("errors during save."); } } else { alert("validation failed."); /**/ }
Code:
isc.DynamicForm.create({ ID:"TaskSubscriberForm", autoDraw:false, dataSource:"TaskSubscriber", numCols:6, overflow:"hidden", fields:[ { name:"TaskID", _constructor:"HiddenItem" }, { name:"ProjectID", visible:false, disabled:false, _constructor:"TextItem" }, { name:"CommunityID", endRow:true, visible:false, disabled:false, _constructor:"TextItem" }, { name:"TeamMemberID", title:"Team Member", visible:false, width:300, colSpan:3, required:true, valueField:"TeamMemberID", displayField:"TeamMemberName", optionDataSource:TeamMember, optionOperationId:"excludeCurrentTaskSubscribers", autoFetchData:false, cachePickListResults:"false", _constructor:"SelectItem" }, { canEdit:false, name:"TeamMemberName", title:"Team Member", width:300, colSpan:3, visible:false, shouldSaveValue:false, disabled:false, _constructor:"TextItem" }, { name:"UndoButton", title:"UNDO", startRow:false, endRow:false, disabled:true, click:"Log.setPriority(\"Log\", 5);\nLog.logDebug(\"********************** TaskSubscribersForm.UndoButton.Click\");\n\n var form = this.form;\n form.reset();\n form.changesPending = false;\n form.newLogEntry = null;\n form.getItem(\"SaveButton\").setDisabled(true);\n form.getItem(\"UndoButton\").setDisabled(true);\n form.clearErrors(true);\n\nLog.logDebug(\"***END***END***END*** TaskSubscribersForm.UndoButton.Click\");", _constructor:"ButtonItem" }, { name:"SaveButton", title:"SAVE", startRow:false, disabled:true, click:"TaskSubscriberForm_SaveButton_click(this.form);", _constructor:"ButtonItem" }, { name:"AnyChangeOption", title:"Any Change Option", titleOrientation:"top", _constructor:"CheckboxItem" }, { name:"StatusChangeOption", title:"StatusChangeOption", titleOrientation:"top", prompt:"Select to be alerted on changes in status, due date or owner.", _constructor:"CheckboxItem" }, { name:"DueReminderOption", title:"Due Reminder Option", titleOrientation:"top", startRow:false, _constructor:"CheckboxItem" }, { name:"DueReminderDate", title:"Due Reminder Date", titleOrientation:"top", _constructor:"DateItem" }, { name:"DueReminderTime", title:"Due Reminder Time", titleOrientation:"top", defaultValue:"08:00 am", _constructor:"TimeItem" } ], width:"100%", height:"100%", visibilityChanged:"", itemChanged:"Log.setPriority(\"Log\", 5);\nLog.logDebug(\"********************** TaskSubscribersForm.itemChanged\");\n\n this.getItem(\"SaveButton\").setDisabled(false);\n this.getItem(\"UndoButton\").setDisabled(false);\n\nLog.logDebug(\"***END***END***END*** TaskSubscribersForm.itemChanged\"); " })
If the TimeItem validation fails on the server, why not at the client on the form, first?
Why does the server accept '08:00' as input, but not '8:00'?
Interesting, yes?
Rick
P.S. I am running SmartClient Version: v8.3p_2014-06-27/EVAL on Mozilla Firefox 20.0 with Firebug using Windows 7 Premium 64 bit.
Comment