Hugh Gibson schrieb:
I find this in _setProperty method of QxBuilder adn i'm wondering ¿why the name is in lowercase?
  // TODO : find a cheaper way to find the setter
// NOTE : the name is LOWERCASE - hence we iterate all properties of the widget
  //         to try and find a matching one

This single item may be the cause of qxBuilder being reportedly slow.

You would have to run some tests to establish why the names are lowercase - 
perhaps it's a misunderstanding as XML is case-sensitive for attributes.

Hugh


Hugh, you are a genius! This is why QxBuilder went into virtual nirvana on very complex widgets. Here is my quick-and-dirty fix:

proto._setProperties = function(widget, name, value) {
var set = "set";
   var setterName = set + name.substr(0,1).toUpperCase() + name.substr(1);
   var setter = widget[ setterName ];
if ( typeof setter != "function" && this._flags.strict) { // try these special names var l= ["Show","Allow","Icon","ZIndex","Timer","Padding","VerticalBlock","Background","Read",];
       for ( var i=0; i<l.length; i++) {
           var s1 = l[i];
var s2 = name.substr(s1.length,1).toUpperCase() + name.substr(s1.length+1);
           var n = set + s1 + s2;
           if (setterName.toLowerCase() == n.toLowerCase() ) {
               var setter = widget[n];
               break;
           };
       };
this.debug ( "Warning: Searching setter '" + setterName + "' manually." ) ; // try all properties ... slow!!
       if ( typeof setter != "function" ) {
           var n = set + name;
           for (var a in widget) {
               if (n == a.toLowerCase()) {
                   var setter = widget[a];
                   break;
               };
           };
       }
// all attempts failed
       if ( typeof setter != "function" ) {
throw this._newBuildError('no setter ' + setterName + ' defined on widget instance', {widget:widget, property:name});
       };
   };
   setter.apply(widget, value);
};

The list ["Show","Allow","Icon","ZIndex","Timer","Padding","VerticalBlock","Background","Read",] has to be expanded to encompass all property names that have a fooBarBaz format (Note you need only to put the "fooBar" into the list, and the algorithm will find all FooBar* property names.

This small fix significantly speeds up things...

Thanks again!!!

Christian


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to