Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Overriding init function of FormItem fails allocate global identifier.

    If I override the init function of FormItem then the javascript global identifier is not allocated.

    The following demonstrates the problem;

    Code:
       isc.FormItem.addProperties({
            init: function () {
                this.Super("init", arguments);
            }
        });
    
        isc.DynamicForm.create({
            fields: [{ ID: "test1", name: "test1"}]
        });
    
        if (window["test1"])
            isc.say("test1 does exist");
        else
            isc.say("test1 does not exist");
    If the init override is removed then window["test1"] is allocated as expected.

    Am I doing something wrong or is there an alternative method when dealing with FormItem's ?

    Tested using IE9, Firefox 5.0.1, Chrome 12.0.742.122.

    SmartClient Version: SC_SNAPSHOT-2011-07-18/LGPL Development Only

    #2
    Call this.Super("init", arguments). Always required to preserve superclass functionality.

    Comment


      #3
      As per original post, that is what I'm doing.

      Comment


        #4
        No, what you're doing is redefining the init function for the existing class FormItem, hence destroying the functionality of the existing FormItem.init().

        Comment


          #5
          Yes, that would be a really stupid thing to do.

          Comment

          Working...
          X