On Sun, Feb 6, 2011 at 12:46 PM, Max Vasiliev <[email protected]> wrote:

> BTW, agreed you should create a custom widget which will have
> 'setChecked' method.
>

As I said - I would rather not create a costume event. I want something that
bubbles. I'm creating costume input fields. The point is that I want to be
able to inject the in a way that will behave like normal inputs - so if a
form needs to submit on change, it can do that with delegation instead of
subscribing to each input separately. I want separation between the form
management and the input creation.

right now I'm using a mitigating observer that observes the inputs and is
observed by the form. something like:

var observer = new Events;// (mootools generic events class)
form.addEvent('change',function(value){
this.submit();
});

var ci = new CostumInput;//just for example

ci.addEvent('change',function(v){
observer.fireEvent('change',v);
});

this obviously works but it feels weird doing this when the DOM already
supports a better mechanism for notifying parents their children fired
events.

-- 
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to