Hi Stefan,
you should compare this framework with java or another OO-language...
that's an object and not a tree or what else.
I give you an example that would make it difficult with your way (access
by element structure):
array.forEach(function(item){
var textField = new qx.ui.form.TextField(item.value);
this.content.add(textField);
},this);
And now?
this.content.textField?
When you change the order of the children/remove a children in your
object, you'll have a problem with getChildren()[index].
I hope this answer give you a better view of this "art" of coding ;o)
Greez
Am 07.03.2010 11:02, schrieb Stefan Meyer:
> but a direct call isnt possible? This isnt very readabel but thats will work
>
> this.toolbar2.getChildren()[0].getChildren()[1].setEnabled(true)
>
> isnt their any structr access possible ? here i use the element names?
>
>> 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
>>
>>
>>
>
> ------------------------------------------------------------------------------
> 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