On/Off 按下取消按钮后时间(日期时间字段)没有被清除
On/Off time(datetime field) doesn't cleared after cancel button is pressed
我打开页面属性并填写一些字段
在我按下取消按钮并重新打开属性对话框后,所有字段都被清除,但日期时间字段没有。
清除日期时间字段的正确方法是什么?
我正在调试并发现 \ibs\cq\ui\widgets\source\ext\override\widgets\form\Field.js
中 isApplyDefault 方法的奇怪行为。它是比较创建和修改日期,如果它们等于 returns 则为真,否则为假。
我只是在 DateTime.js 中 ovveride 方法 processRecord 以删除调用 isApplyDefault:
processRecord: function(record, path) {
if (this.fireEvent('beforeloadcontent', this, record, path) !== false) {
var v = record.get(this.getName());
if (v == undefined && this.defaultValue != null) {
this.setValue(this.defaultValue);
}
else {
this.setValue(v);
}
this.fireEvent('loadcontent', this, record, path);
}
}
在Field.js中是:
processRecord: function(record, path) {
if (this.fireEvent('beforeloadcontent', this, record, path) !== false) {
var v = record.get(this.getName());
if (v == undefined && this.defaultValue != null) {
if (this.isApplyDefault(record, path)) {
this.setValue(this.defaultValue);
}
}
else {
this.setValue(v);
}
this.fireEvent('loadcontent', this, record, path);
}
}
另见 adobe forum
我打开页面属性并填写一些字段
在我按下取消按钮并重新打开属性对话框后,所有字段都被清除,但日期时间字段没有。
清除日期时间字段的正确方法是什么?
我正在调试并发现 \ibs\cq\ui\widgets\source\ext\override\widgets\form\Field.js
中 isApplyDefault 方法的奇怪行为。它是比较创建和修改日期,如果它们等于 returns 则为真,否则为假。
我只是在 DateTime.js 中 ovveride 方法 processRecord 以删除调用 isApplyDefault:
processRecord: function(record, path) {
if (this.fireEvent('beforeloadcontent', this, record, path) !== false) {
var v = record.get(this.getName());
if (v == undefined && this.defaultValue != null) {
this.setValue(this.defaultValue);
}
else {
this.setValue(v);
}
this.fireEvent('loadcontent', this, record, path);
}
}
在Field.js中是:
processRecord: function(record, path) {
if (this.fireEvent('beforeloadcontent', this, record, path) !== false) {
var v = record.get(this.getName());
if (v == undefined && this.defaultValue != null) {
if (this.isApplyDefault(record, path)) {
this.setValue(this.defaultValue);
}
}
else {
this.setValue(v);
}
this.fireEvent('loadcontent', this, record, path);
}
}
另见 adobe forum