thats all well and good but what i want to do is allow for both direct injection of an onchange function into the class and use of the native onchange attribute of the select box i have posted an example to http://mooshell.net/TCPae/ For some reason though the mooshell is using HTML Strict and the FX is not working the way it should. Is this a bug/issue with the framework or something with my code? Regardless....i have an example of both methods there.
_____ From: Thierry bela nanga [mailto:[email protected]] Sent: Wednesday, 21 October 2009 2:24 AM To: [email protected] Subject: [Moo] Re: fireEvent() on a select box this is my custom select, I did not manage the onChange property but the events added with addEvent('change', fn) work just fine, http://dl.getdropbox.com/u/1731360/ui.html plain text http://dl.getdropbox.com/u/1731360/ui.txt js http://dl.getdropbox.com/u/1731360/built.js On Tue, Oct 20, 2009 at 2:19 PM, Ryan Florence <[email protected]> wrote: Why don't you post the whole class onto mooshell or pastebin with a test case? On Oct 20, 2009, at 7:11 AM, Steve Onnis wrote: ...but should fireEvent work? From: Fábio M. Costa [mailto:[email protected]] Sent: Tuesday, 20 October 2009 11:26 PM To: [email protected] Subject: [Moo] Re: fireEvent() on a select box you could use the Function Constructor. I have never used it but it might work. var changeEvent = new Function(this.element.getProperty('onchange')).bind(this); -- Fábio Miranda Costa Solucione Sistemas Engenheiro de interface On Tue, Oct 20, 2009 at 1:55 AM, Steve Onnis <[email protected]> wrote: I have been writing a class to replace select boxes with custom UL select boxes and i am trying to get my code to fire the onchange that is on the selectbox What i tried was this... this.options.onchange = !options.onChange ? (function () {this.element.fireEvent("change")}.bind(this)) : options.onChange.bind(this); and then i have this on the click event of the list this.options.onchange.run(); The function ran but the event didn't fire The only way I could get it to work is by using this which I didn't think was ideal (function () {eval(this.element.getProperty("onchange"))}.bind(this)) Am I doing something wrong here? Steve -- http://tbela99.blogspot.com/ fax : (+33) 08 26 51 94 51
