I've found the solution ; The event on the button must declared like this :

[...]
wm1.add(b_test);
b_test.addEventListener("execute",function(){
                this.showMenu();
});
d.add(wm1);
[...]

"addEventLIstener" method written after the "add" method, strange !


frederic wrote:
> 
> hello,
> I have this error message :
> ERROR: qx.ui.form.Button[180]: Could not dispatch event of type "execute":
> TypeError - myclass.test is not a constructor
> 
> When I try this script "test.js" :
> 
> 
> qx.OO.defineClass("myclass.test", qx.component.AbstractComponent,
> function() {
>   qx.component.AbstractComponent.call(this);
> });
> 
> qx.Proto.mytest = function() {
>       var d=qx.ui.core.ClientDocument.getInstance();
>       var wm1 = new qx.ui.window.Window("My Window");
>       wm1.setSpace(50, 200, 50, 200);
>       b_test=new qx.ui.form.Button("test"),
>       b_test.addEventListener("execute",function(){
>               this.showMenu();
>       });
>       wm1.add(b_test);
>       d.add(wm1);
>       wm1.show();
> }
> 
> qx.Proto.showMenu=function() {
>       alert("test ok");
> }
> 
> 
> This object is called with this code :
> 
> var test=new myclass.test;
> test.mytest()
> 
> 
> It is impossible to access to ShowMenu method in the object definition
> ("test.js") throw this.ShowMenu() ; how to do ?
> 
> frederic
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Own-object-and-access-to-data-tf2318762.html#a6451692
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to