View Full Version : Button handler from uncreated object's function

12 Mar 2010, 5:45 AM

I have a problem and I didn't solve it for 2 days.

I have two classes such as classX and classY. classX is dealing with interface and classY is dealing with the processes. Config of classX has some button definitions with handlers. classX is created first, and then classY is created.

When I add handler of button to classY's function, I got "undefined classY" error. How can I overcome this problem without defining the same functions before?

Ex :
config = { buttons : [text: 'test', handler : 'objectY.testFunction'] };
objectX = new classX (config);

configY = { objectX.someValue };
objectY = new classY (configY);

I hope the problem is clear.