-
Notifications
You must be signed in to change notification settings - Fork 29
UI.View.init
kerrishotts edited this page Apr 1, 2013
·
1 revision
(part of UI.View)
Returns: void
Parameters: [ noNotify (boolean) ]
Initializes the view, and creates the associated DOM element. The DOM element is created using the object's class, hence why it is not created during the constructor (when it would always see 'UIView' first), but in the init
phase instead.
For example, an instance of a class named UILabel
will have a corresponding DOM element of <uilabel/>
.
When a view has finished initialization, the notification viewDidInit
is sent.
noNotify
is used when calling the super method in order to prevent multiple notifications of viewDidInit
. It should never be passed outside of a subclassed init
method.
var aView = new UI.View();
aView.init();
// but in a subclass:
self.overrideSuper ( self.class, "init", self.init );
self.init = function ( noNotify )
{
self.super ( "classname", "init", true );
...
if (!noNotify)
{
self.notify ('viewDidInit');
}
}
0.3 Introduced; Docs Valid.