amplesdk icon indicating copy to clipboard operation
amplesdk copied to clipboard

ample.publish doesn't like one class

Open finalstep opened this issue 15 years ago • 0 comments

I have several widgets which inherit, so I've published the ancestor widget classes: ample.publish(TextFieldBase, 'TextFieldBase', fs); No problem. Input.prototype = new fs.TextFieldBase(); No problem.

I have been using ample.extend for the Input class (an enhanced text field) with no problem. But now I have a widget which subclasses Input, so I want to publish it. ample.publish(Input, 'Input', fs); results in an error message: The definition for s:input is not found in the namespace 'http://www.finalstep.com.au/2010/standard'

The namespace is correctly specified - all works fine with extend(). Tried renaming from Input (in case it collided with a reserved name) to ABC. ample.publish(ABC, 'ABC', fs) No good. Tried changing the locaName from input to 'notinput'. No good.

So I'm a bit puzzled as to why this particular class causes a problem for publish().

My workaround is to simply define the class as a property of the global fs. fs.Input = function() {}; This appears to work ok.

So two questions: (1) any idea why a class might be extended ok but not get published? (2) what am I losing if I define my classes directly under the global fs?

finalstep avatar Nov 28 '10 23:11 finalstep