Hi Jim,

what is the real error printed out? At least your "check" declaration is wrong. In 0.7.x the "check" for built-in types begins with an uppercase letter (in most cases): "string" must be "String".

Sebastian




Am 10.08.2007 um 03:26 schrieb Jim Hunter:

Interestingly, I decided to take your advice and not over-ride the automatically created getter and created a totally new function for this purpose. Now the code that applies it to the Widget does not cause the program to stop execution. In fact, the new method can be getting called from any Widget. But the property that I described in the same Mixin is not getting a setter or getter created in the object. Here is the new code snippet:

      qx.Mixin.define("Application.MObject",
      {
        "properties" :
        {
          "ToolId" :
          {
            check         : "string",
            init : ""
          }
        },

        "members" : {
          whatsMyToolId : function()
          {
            if (this.getToolId() == null) {
              return this.getParent().whatsMyToolId();
            } else if (this.getToolId() == '') {
              return this.getParent().whatsMyToolId();
            }
            else return this.getToolId();
          }

          }
      });

      qx.Class.include(qx.ui.core.Widget, Application.MObject);


The following code executes:

x = new qx.ui.basic.Atom;
alert(x.whatsMyToolId());

since ToolId is not set it returns undefined (I also did a straight 'return "X"' in the function and the above code popped up an alert with X in it so I know this method has been applied to all widgets like I would expect); The following code does not work, it stops execution on the setToolId call:

x = new qx.ui.basic.Atom;
x.setToolId('11111');  //it fails on this line.
alert(x.getToolId());

so why is the 'whatsMyToolId' method getting applied to the class but no getToolId or setToolIs methods?

Thanks,
Jim





On 8/9/07, Jim Hunter <[EMAIL PROTECTED]> wrote:
I am creating a new property and then using my own getter for it. What is the new way to do that. And I need to apply this new property to Widget. I need to add a common property to all Widgets. And it's not a simple property, I need to write the code for the getter.

Jim


On 8/9/07, Alexander Back < [EMAIL PROTECTED]> wrote:
Hi Jim,

Jim Hunter schrieb:
> I have read the propertied pages in the wiki and I don't see any
> examples of th enew way to overwrite the getter. What is the syntax of
> the new way to do this?
In general overwriting the getter method is no good idea. Currently
there is no "official" way doing this.

Can you solve your problem by writing your own getter method instead
overwriting the existing one?

cheers,
   Alex


---------------------------------------------------------------------- ---
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to