Hi, This command will call a function reference/variable with the name part (this.toolbar1.part). But the toolbar object hasn't got this item.
An easy way is to save the button as a private variable in your class and call them with the this-operator directly. this.__newButton = new qx.ui.toolbar.Button(...); ... this.__newButton.setEnabled(true); Good night. Am 07.03.2010 00:53, schrieb [email protected]: > Hello i create some toolbars like this > > getToolbar1 : function() { > // create the toolbar > this.toolbar1 = new qx.ui.toolbar.ToolBar(new > qx.ui.layout.Dock()).set({ > decorator : "main", > allowStretchX : true, > allowStretchY : true > }); > // create and add Part 1 to the toolbar > var part1 = new qx.ui.toolbar.Part(); > var newButton = new qx.ui.toolbar.Button("Neu", > "jobs/icon/16/actions/document-new.png"); > var editButton = new qx.ui.toolbar.Button("Bearbeiten", > "jobs/icon/16/actions/edit-paste.png"); > var deleteButton = new qx.ui.toolbar.Button("Entfernen", > "jobs/icon/16/actions/edit-delete.png"); > > newButton.addListener("execute", function(e) { > alert("Neu"); > },this); > editButton.addListener("execute", function(e) { > alert("Bearbeiten"); > },this); > editButton.setEnabled(false); > deleteButton.addListener("execute", function(e) { > alert("Entfernen"); > },this); > deleteButton.setEnabled(false); > > > > // Export > var exportMenu = new qx.ui.menu.Menu(); > exportMenu.setEnabled(false); > var button = Array(); > button[0] = new qx.ui.menu.Button("PDF", > "jobs/icon/16/actions/home.png"); > button[0].addListener("execute", function(e) { > alert("Export CSV"); > },this); > exportMenu.add(button[0]); > button[1] = new qx.ui.menu.Button("CSV", > "jobs/icon/16/actions/home.png"); > button[1].addListener("execute", function(e) { > alert("Export CSV"); > },this); > exportMenu.add(button[1]); > var exportButton = new > qx.ui.toolbar.MenuButton("Export","jobs/icon/16/actions/home.png",exportMenu); > > > part1.add(newButton); > part1.add(editButton); > part1.add(deleteButton); > part1.add(new qx.ui.toolbar.Separator()); > part1.add(exportButton); > this.toolbar1.add(part1); > > return this.toolbar1; > }, > > > now i want to access the different buttons and enable them like this > > this.table1.addListener("cellClick", function(e) { > > var row = e.getRow() > var column = e.getColumn() > alert("ID: "+this.tableModel1.getValue(0, row)); > > alert(this.toolbar1.part.newButton.setEnabled(true)); > alert(this.toolbar1.part.editButton.setEnabled(true)); > alert(this.toolbar1.part.deleteButton.setEnabled(true)); > alert(this.toolbar1.part.exportButton.setEnabled(true)); > > > }, this); > > > but i alwys get errors. the object is since the > alert(this.toolbar1.part); > > undefined but i add the part1 and some buttons into the part1 in the > function above:( WHy i cant access them? > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
