Helper class for component Creators providing various methods for creating views for the associated page. Creator implementors should create any view instances through this class instead of trying to instantiate Views on their own.
Start with acquiring an instance with ComponentFactory.create, then you can call its instance methods to create various built-in components.
- Version:
- 16.3.5
- Source:
Methods
(static) create(page) → {components.dt/js/api/ComponentFactory}
stable API
Factory create method returning an instance of this class.
Parameters:
Name | Type | Description |
---|---|---|
page |
pages.dt/js/api/Page | page you will create components for. |
- Version:
- 16.3.5
- Source:
Returns:
createView(createContext) → {pages.dt/js/api/View}
stable API
Creates a generic view of given type with defined properties.
In custom Creators you should use this method to create your views instead of trying to construct View instances directly though their constructors.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
createContext |
Object |
Properties
|
- Version:
- 16.3.5
- Source:
Returns:
created view
- Type
- pages.dt/js/api/View
Example
Creator.prototype.createView = function (activePage) {
var componentFactory = ComponentFactory.create(activePage);
var properties = {
myProp: 'prop value'
};
// create the view for this component
var view = componentFactory.createView({
displayName: 'My Custom Component',
type: 'my.componentId',
properties: properties
});
view.getProperties().setValue('myProp', 'modified prop value');
return view;
};
Type Definitions
Creates a business action invoked from a collection when user clicks on a link or selects the action from the popup menu.
Returns:
business code action
- Type
- BusinessCode