Gauthier
06-18-2003, 11:00 AM
Hello,
I'm working on components that I want to have 3 events:
-onChange (when the data change)
-onValidate (when the data become valid)
-onUnValidate (when the data becomes unvalid)
I need to trigger these events according specific logic to the code inner each controls that implement these events. These events has to be handled outside of the component (in a parent component for example) the same way I handle events with traditionnal events.
ie:
myElm.onclick = function(){alert('you just clicked');}
myComponent.onChange = function(){}
I want if it's possible to obtain a reference of the component that trigger the event to be accessible in the event handler code. I wonder if the keyword 'this' will have this behavior in the event handler code?
is it possible to do this kind of development with Javascript? (it has to work with IE5+ and Mozilla 1+)
Does anyone that know how to do will show me the right syntax?
Thanks alot for your assistance.
I'm working on components that I want to have 3 events:
-onChange (when the data change)
-onValidate (when the data become valid)
-onUnValidate (when the data becomes unvalid)
I need to trigger these events according specific logic to the code inner each controls that implement these events. These events has to be handled outside of the component (in a parent component for example) the same way I handle events with traditionnal events.
ie:
myElm.onclick = function(){alert('you just clicked');}
myComponent.onChange = function(){}
I want if it's possible to obtain a reference of the component that trigger the event to be accessible in the event handler code. I wonder if the keyword 'this' will have this behavior in the event handler code?
is it possible to do this kind of development with Javascript? (it has to work with IE5+ and Mozilla 1+)
Does anyone that know how to do will show me the right syntax?
Thanks alot for your assistance.