Class Component

Provides the base class for the Control and Behavior classes, and for any other object whose lifetime should be managed by the ASP.NET AJAX client library.

see

{@link http://msdn.microsoft.com/en-us/library/bb397516(v=vs.100).aspx}

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(): Component

When overridden in a derived class, initializes an instance of that class and registers it with the application as a disposable object.

Returns

Component

Methods

public add_disposing(handler: Function)

Raised when the dispose method is called for a component.

Parameters

  • handler: Function

public add_propertyChanged(handler: Function)

Raised when the raisePropertyChanged method of the current Component object is called.

Parameters

  • handler: Function

public beginUpdate()

Called by the create method to indicate that the process of setting properties of a component instance has begun.

public static create(type: Type, properties?: any, events?: any, references?: any, element?: HTMLElement): Component

Creates and initializes a component of the specified type. This method is static and can be called without creating an instance of the class.

Parameters

  • type: Type
          The type of the component to create.
    
  • properties?: any optional
          (Optional) A JSON object that describes the properties and their values.
    
  • events?: any optional
          (Optional) A JSON object that describes the events and their handlers.
    
  • references?: any optional
          (Optional) A JSON object that describes the properties that are references to other components.
    
  • element?: HTMLElement optional
          (Optional) The DOM element that the component should be attached to.
    

Returns

Component

A new instance of a component that uses the specified parameters.

public dispose()

Raises the disposing event of the current Component and removes the component from the application.

public endUpdate()

Called by the create method to indicate that the process of setting properties of a component instance has finished. This method is called by the create method ($create). Sets the isUpdating property of the current Component object to false, calls the initialize method if it has not already been called, and then calls the updated method.

public get_events(): any

Gets an EventHandlerList object that contains references to all the event handlers that are mapped to the current component's events. This member supports the client-script infrastructure and is not intended to be used directly from your code.

Returns

any

 An EventHandlerList object that contains references to all the events and handlers for this component.

public get_id(): string

Gets the ID of the current Component object.

Returns

string

  The id

public get_isInitialized(): boolean

Gets a value indicating whether the current Component object is initialized.

Returns

boolean

 true if the current Component is initialized; otherwise, false.

public get_isUpdating(): boolean

Gets a value indicating whether the current Component object is updating.

Returns

boolean

 true if the current Component object is updating; otherwise, false.

public initialize()

Initializes the current Component object. The initialize method sets the isInitialized property of the current Component object to true. This function is called by the create method ($create) and overridden in derived classes to initialize the component.

public raisePropertyChanged(propertyName: string)

Raises the propertyChanged event for the specified property.

Parameters

  • propertyName: string
              The name of the property that changed.
    

public remove_disposing(handler: Function)

Raised when the dispose method is called for a component.

Parameters

  • handler: Function

public remove_propertyChanged(handler: Function)

Raised when the raisePropertyChanged method of the current Component object is called.

Parameters

  • handler: Function

public set_id(value: string)

Sets the ID of the current Component object.

Parameters

  • value: string

    A string that contains the ID of the component.

public updated()

Called by the endUpdate method as a placeholder for additional logic in derived classes. Override the updated method in a derived class to add custom post-update logic.