DynamicForm (and other object) Events

Main Question:
I have a dynamic form that I need certain buttons disabled if it is editing a new record, but enabled once the record is saved (editing an existing item). Is there an event on the form for “Edit Start” or “OnEditNewRecord” and/or “OnEditRecord?”

Second Question:
I feel kind of stoopid every time I start looking for ways to trace SmartClient events. I looked through the reference 6.0 for Datasources and DynamicForms, but I don’t see where you can hook any events.

Every time I come across such an issue, I end up posting it here and you guys come back with an appropriate event handler. I was wondering if the smartclient objects have any standard naming conventions for events? Such as… if there’s a method called “EditNewRecord()” is there a corresponding event in most cases named something like: “OnEditNewRecord”?

Is there a way to locate smartclient events with the Developer console?
Are events documented anywhere else?

Thanks in advance

Paul

Hi Paul,

In SmartClient you don’t need separate events. Because SmartClient is an object oriented system you can just override methods and call Super.

So for example, let’s say you have a form and you want to do something when editRecord() is called:

isc.DynamicForm.create({
    ...
    editRecord : function () {
        // do something before
        var returnValue = this.Super("editRecord", arguments);
        // do something after
        return returnValue;
    }
})

Alternatively you can use class.observe() to take action when something is called, this is sometimes more compact. For example:

    // match height
    myWidget.observe(otherWidget, "resized",
                     "observer.setHeight(observed.getHeight())");

In a nutshell, every method can be used as an “event”.

LOL I wonder why that never occurred to me before.

Thanks