On/Off time(datetime field) doesn't cleared after cancel button is pressed

I open page properties and fill some fields

After I pressed cancel button, and reopened properties dialog, all field cleared, but datetime fields didn't.

What is the rigth way to clear datetime fields?

Answers


I was debuggin and find out strange behavior of isApplyDefault method in \ibs\cq\ui\widgets\source\ext\override\widgets\form\Field.js. It is compare created and modefied date, if they equals returns true, otherwise false.

I just ovveride method processRecord in DateTime.js to remove calling 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);
    }
}

in Field.js it is:

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);
    }
}

See also in adobe forum


Need Your Help

Explode my Array, remove dash from key, then Implode it back together

php arrays explode implode

What I want to do is remove the - dash from the key in my array and then rebuild it back together with a space in place of the -.

Wrapping legacy object in IConnectableObservable

c#-4.0 system.reactive reactive-programming

I have a legacy event-based object that seems like a perfect fit for RX: after being connected to a network source, it raises events when a message is received, and may terminate with either a single

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.