JavaScript Extension Development API for Oracle Visual Builder Cloud Service - Classic Applications

Class: components.dt/js/api/ComponentFactory

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:
Type
components.dt/js/api/ComponentFactory

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
Name Type Attributes Description
displayName String

view display name, for example 'Text Field', 'Opportunity Table' etc.

type String

view type you want to create

properties Object <optional>

a map of view properties.

You do not have to construct view Properties yourself, instead pass a simple key-value map of your view properties and the instance will be created and injected into the created view by this method automatically (and obtained later with View.getProperties).

Version:
  • 16.3.5
Source:
Returns:

created view

Type
pages.dt/js/api/View
Example

How to create a view in my Creator

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.

Source:
Returns:

business code action

Type
BusinessCode