On Mon, Mar 8, 2010 at 11:16, Qoodary Doo <[email protected]> wrote:

> Hi Derrell,
>
> great, it works now with your solution and with one addListener.
> Thank you so much !!!!
>
You're welcome.

>
> I have learned a lot with you, even if I have not understand all in
> details.
> especially what you have donw with the "setUserData" and "getUserData".
> I first thought this was wrong written and means my "getTableData"
> function :-)
>

If you look at the implementation of setUserData and getUserData, it'll
likely be clear what's going on. setUserData is just saving the object you
pass as the second parameter in a map, identified by the string you pass in
the first parameter. getUserData just does a look-up in that map and returns
the value. Many people have an aversion to looking at the underlying source
code, but I'm a huge advocate of doing so. You learn an incredible amount by
looking at how things are done. Here's the implementation from
qx/core/Object.js:

    /** {Map} stored user data */
    __userData : null,


    /**
     * Store user defined data inside the object.
     *
     * @param key {String} the key
     * @param value {Object} the value of the user data
     * @return {void}
     */
    setUserData : function(key, value)
    {
      if (!this.__userData) {
        this.__userData = {};
      }

      this.__userData[key] = value;
    },


    /**
     * Load user defined data from the object
     *
     * @param key {String} the key
     * @return {Object} the user data
     */
    getUserData : function(key)
    {
      if (!this.__userData) {
        return null;
      }
      var data = this.__userData[key];
      return data === undefined ? null : data;
    },

Hope that helps.

Derrell
------------------------------------------------------------------------------
Download Intel&#174; 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

Reply via email to