# Component

Namespace: **Wisej.Base**

Assembly: **Wisej.Framework** (4.0.0.0)

The base class for Wisej components that are not controls. Wisej components are still managed on the client and the server but are not present on the designer surface. Examples of wisej components are: menu items, image lists, tree nodes, list items.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Component : IDisposable, IWisejComponent, IWisejSerializable, IUserData
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Component
    Inherits IDisposable
    Implements IWisejComponent, IWisejSerializable, IUserData
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) Component()

Default constructor

### ![](/files/hsR4ok3152WyAf8J2C1u) Component(embedded)

Default constructor

| Name         | Type                                                            | Description                                                                                                                                                                                    |
| ------------ | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **embedded** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | Indicates whether the component is embedded in a parent component. Embedded components don't update themselves, instead their parent is in charge of updating the corresponding client widget. |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) HasUserData

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Checks if the [UserData](#userdata) dynamic object was created and has any value. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) InClientEvent

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns true if the component is processing a client event.

### ![](/files/hsR4ok3152WyAf8J2C1u) IsDisposed

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Indicates that the component has been disposed. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) UserData

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns a dynamic object that can be used to store custom data in relation to this component.

Default value is {}.

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) Call(function, args)

Runs the JavaScript *function* within the component's context in the browser.

| Parameter    | Type                                                              | Description                                     |
| ------------ | ----------------------------------------------------------------- | ----------------------------------------------- |
| **function** | [String](https://docs.microsoft.com/dotnet/api/system.string)     | The name of the JavaScript function to execute. |
| **args**     | [Object\[\]](https://docs.microsoft.com/dotnet/api/system.object) | The arguments to pass to the function.          |

### ![](/files/hsR4ok3152WyAf8J2C1u) Call(function, callback, args)

Runs the JavaScript *function* within the component's context in the browser and returns the value to the *callback* method.

| Parameter    | Type                                                                     | Description                                                  |
| ------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------ |
| **function** | [String](https://docs.microsoft.com/dotnet/api/system.string)            | The name of the JavaScript function to execute.              |
| **callback** | [Action\<Object>](https://docs.microsoft.com/dotnet/api/system.action-1) | Asynchronous callback method that receives the return value. |
| **args**     | [Object\[\]](https://docs.microsoft.com/dotnet/api/system.object)        | The arguments to pass to the function.                       |

### ![](/files/hsR4ok3152WyAf8J2C1u) CallAsync(function, args)

Asynchronously runs the JavaScript *function* within the component's context in the browser and returns an awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) containing the value returned by the remote call.

| Parameter    | Type                                                              | Description                                     |
| ------------ | ----------------------------------------------------------------- | ----------------------------------------------- |
| **function** | [String](https://docs.microsoft.com/dotnet/api/system.string)     | The name of the JavaScript function to execute. |
| **args**     | [Object\[\]](https://docs.microsoft.com/dotnet/api/system.object) | The arguments to pass to the function.          |

**Returns:** [Task\<Object>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). An awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that represents the asynchronous operation.

### ![](/files/hsR4ok3152WyAf8J2C1u) Dispose()

Releases all resources used by the [Component](/api/wisej.base/general/wisej.base.component.md).

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

Marks this component as disposed.

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Eval(javaScript)

Runs the *javaScript* code within the component's context in the browser.

| Parameter      | Type                                                          | Description                               |
| -------------- | ------------------------------------------------------------- | ----------------------------------------- |
| **javaScript** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The JavaScript code to run on the client. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Eval(javaScript, callback)

Runs the *javaScript* code within the component's context in the browser and returns the value to the *callback* method.

| Parameter      | Type                                                                     | Description                                                  |
| -------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------ |
| **javaScript** | [String](https://docs.microsoft.com/dotnet/api/system.string)            | The JavaScript code to evaluate on the client.               |
| **callback**   | [Action\<Object>](https://docs.microsoft.com/dotnet/api/system.action-1) | Asynchronous callback method that receives the return value. |

### ![](/files/hsR4ok3152WyAf8J2C1u) EvalAsync(javaScript)

Asynchronously runs the *javaScript* code within the component's context in the browser and returns an awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that contains the value returned by the remote call.

| Parameter      | Type                                                          | Description                                    |
| -------------- | ------------------------------------------------------------- | ---------------------------------------------- |
| **javaScript** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The JavaScript code to evaluate on the client. |

**Returns:** [Task\<Object>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). An awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that represents the asynchronous operation.

### ![](/files/lzopMboA31bVq8UIcbT3) Finalize()

Destructor dispose pattern.

### ![](/files/lzopMboA31bVq8UIcbT3) InvokeFilter(data, type)

Invokes the [Filter](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md#filter) method.

| Parameter | Type                                                          | Description                               |
| --------- | ------------------------------------------------------------- | ----------------------------------------- |
| **data**  | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Data passed to the filter implementation. |
| **type**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | Name of the filter being invoked.         |

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object).

### ![](/files/lzopMboA31bVq8UIcbT3) OnAddReferences(list)

Returns a collection of referenced components or collection of components.

| Parameter | Type                                                                    | Description                                                |
| --------- | ----------------------------------------------------------------------- | ---------------------------------------------------------- |
| **list**  | [IList](https://docs.microsoft.com/dotnet/api/system.collections.ilist) | List of referenced components or collection of components. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type                                                        | Description      |
| --------- | ----------------------------------------------------------- | ---------------- |
| **e**     | [WisejEventArgs](/api/wisej.core/general/wisejeventargs.md) | Event arguments. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebUpdate(state)

Updates the client component using the state information.

| Parameter | Type                                                          | Description           |
| --------- | ------------------------------------------------------------- | --------------------- |
| **state** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic state object. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Update()

Updates the component on the client.

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) Disposed

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the component is disposed.

## Inherited By

| Name                                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [BindableComponent](/api/wisej.web/general/wisej.web.bindablecomponent.md)                              | Extends [Component](/api/wisej.web/general/wisej.web.component.md) and enables the component to participated if data binding operations and have their own [DataBindings](/api/wisej.web/general/wisej.web.bindablecomponent.md#databindings).                                                                                                                       |
| [Component](/api/wisej.web/general/wisej.web.component.md)                                              | Extends [Component](/api/wisej.base/general/wisej.base.component.md) and enables the components to appear on the designer surface.                                                                                                                                                                                                                                   |
| [MessageBox](/api/wisej.web/notifications/messagebox.md)                                                | Displays a message box that can contain text, buttons, and symbols that inform and instruct the user.                                                                                                                                                                                                                                                                |
| [Timer](/api/wisej.web/other-components/wisej.web.timer.md)                                             | Implements a timer that raises an event at user-defined intervals.                                                                                                                                                                                                                                                                                                   |
| [DesktopTaskBarItem](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem.md)                 | Represents a component in the [Desktop](/api/wisej.web/containers/desktop.md) control's taskbar.                                                                                                                                                                                                                                                                     |
| [DesktopTaskBarItemControl](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemcontrol.md)   | Represents a component in the [Desktop](/api/wisej.web/containers/desktop.md) control's taskbar that can host any [Control](/api/wisej.web/general/control.md).                                                                                                                                                                                                      |
| [DesktopTaskBarItemDateTime](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritemdatetime.md) | Represents a DateTime component in the [Desktop](/api/wisej.web/containers/desktop.md) control's taskbar.                                                                                                                                                                                                                                                            |
| [Animation](/api/wisej.web/extenders/animation.md)                                                      | Provides support for animating controls or windows using predefined animations definitions or custom animations in response to certain events.                                                                                                                                                                                                                       |
| [ErrorProvider](/api/wisej.web/extenders/errorprovider.md)                                              | Provides a user interface for indicating that a control on a form has an error associated with it.                                                                                                                                                                                                                                                                   |
| [HelpTip](/api/wisej.web/extenders/wisej.web.helptip.md)                                                | Represents a small rectangular pop-up window that displays a brief help text next to a control when it gets activated (focused).                                                                                                                                                                                                                                     |
| [JavaScript](/api/wisej.web/extenders/javascript.md)                                                    | Allows controls to execute javascript code.                                                                                                                                                                                                                                                                                                                          |
| [Rotation](/api/wisej.web/extenders/rotation.md)                                                        | Add rotation capabilities along the X,Y,Z axis to [Control](/api/wisej.web/general/control.md) controls.                                                                                                                                                                                                                                                             |
| [StyleSheet](/api/wisej.web/extenders/wisej.web.stylesheet.md)                                          | Adds CSS styling to controls.                                                                                                                                                                                                                                                                                                                                        |
| [ToolTip](/api/wisej.web/extenders/wisej.web.tooltip.md)                                                | Represents a small rectangular pop-up window that displays a brief description of a control's purpose when the user rests the pointer on the control.                                                                                                                                                                                                                |
| [AlertBox](/api/wisej.web/notifications/alertbox.md)                                                    | Displays an alert box that can contain an icon and text that inform and instruct the user. Alert boxes are not modal and can disappear automatically.                                                                                                                                                                                                                |
| [Toast](/api/wisej.web/notifications/wisej.web.toast.md)                                                | Displays a toast that can contain an icon and text.                                                                                                                                                                                                                                                                                                                  |
| [ComponentTool](/api/wisej.web/editors/wisej.web.componenttool.md)                                      | Represent a tool widget that can be displayed inside another control. A tool widget is different from other child controls: it's displayed inside the parent's layout. For example, the [Form](/api/wisej.web/containers/form.md) control shows tool widgets inside the caption bar. When a tool widget is pressed, it fires the toolClicked event on the container. |
| [ImageList](/api/wisej.web/content/imagelist.md)                                                        | Provides methods to manage a collection of [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) objects. This class cannot be inherited.                                                                                                                                                                                                              |
| [ColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader.md)                       | Displays a standard column header in a [ListView](/api/wisej.web/lists-and-grids/listview.md) control.                                                                                                                                                                                                                                                               |
| [ImageColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.imagecolumnheader.md)             | Displays an image column header in a [ListView](/api/wisej.web/lists-and-grids/listview.md) control.                                                                                                                                                                                                                                                                 |
| [CheckedMenuItem](/api/wisej.web/menus/wisej.web.checkedmenuitem.md)                                    | Represents an individual menu item that is displayed within a [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu.md) or [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu.md) and always shows a checkbox next to the label.                                                                                                                                  |
| [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu.md)                                            | Represents a context menu associated to a [Control](/api/wisej.web/general/control.md).                                                                                                                                                                                                                                                                              |
| [LinkMenuItem](/api/wisej.web/menus/wisej.web.linkmenuitem.md)                                          | Represents an individual menu item that is displayed within a [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu.md) or [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu.md) rendered using the \<a> link element to let the browser process the specified [HRef](/api/wisej.web/menus/wisej.web.linkmenuitem.md#href) URL.                                  |
| [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu.md)                                                  | Represents the main menu in a [Form](/api/wisej.web/menus/wisej.web.mainmenu.md#form).                                                                                                                                                                                                                                                                               |
| [Menu](/api/wisej.web/menus/wisej.web.menu.md)                                                          | Represents the base functionality for all menus.                                                                                                                                                                                                                                                                                                                     |
| [MenuItem](/api/wisej.web/menus/wisej.web.menuitem.md)                                                  | Represents an individual item that is displayed within a [MainMenu](/api/wisej.web/menus/wisej.web.mainmenu.md) or [ContextMenu](/api/wisej.web/menus/wisej.web.contextmenu.md).                                                                                                                                                                                     |
| [StatusBarControl](/api/wisej.web/containers/statusbar/wisej.web.statusbarcontrol.md)                   | Represents a panel in a [StatusBar](/api/wisej.web/containers/statusbar.md) control that can host any [Control](/api/wisej.web/containers/statusbar/wisej.web.statusbarcontrol.md#control).                                                                                                                                                                          |
| [StatusBarPanel](/api/wisej.web/containers/statusbar/wisej.web.statusbarpanel.md)                       | Represents a panel in a [StatusBar](/api/wisej.web/containers/statusbar.md) control.                                                                                                                                                                                                                                                                                 |
| [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md)                           | Represents an item in the [ToolBar](/api/wisej.web/containers/toolbar.md).                                                                                                                                                                                                                                                                                           |
| [TreeNode](/api/wisej.web/lists-and-grids/treeview/wisej.web.treenode.md)                               | Represents a node of a [TreeView](/api/wisej.web/lists-and-grids/treeview.md).                                                                                                                                                                                                                                                                                       |

## Implements

| Name                                                                              | Description                                                                                                     |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                  |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.base/general/wisej.base.component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
