3.2.0

How is a control method over-ridden?

I''ve created a new simple control:

Active.Controls.Buttons = Active.System.Control.subclass();

Active.Controls.Buttons.create = function() {
var obj = this.prototype;

var theButton = new Active.HTML.INPUT;
var theButtonAction = function(event) { alert(event.srcElement.value); };

theButton.setAttribute("type", "button");
theButton.setAttribute("value", "my test button");
theButton.setEvent("onclick", theButtonAction);

obj.setContent("theContent", theButton);
};

Active.Controls.Buttons.create();

----

var oButton = new Active.Controls.Buttons;
var oMyFunc = function() { alert("my custom function..."); };

document.write(oButton);


The problem is that I now want to change the controls "onclick" event to my custom function.

How is this done?
Steve
June 3,
I've answered my own question...

oButton.getContent("theContent").setEvent("onclick", oMyFunc);

Steve
June 4,

This topic is archived.

See also:


Back to support forum