Package com.smartgwt.client.rpc

# Class CreateScreenSettings

java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.rpc.CreateScreenSettings

All Implemented Interfaces:
  `HasHandlers`

public class CreateScreenSettings extends DataClass
Controls what class and instance substitutions, if any, are applied during a call to `RPCManager.createScreen()`. Classes and instances can be mapped (constructed as) other classes, and existing widget instances can be returned for new ones.

See Also:
  - `getClassSubstitutions()`
  - `getComponentSubstitutions()`

- ## Field Summary

  ### Fields inherited from class com.smartgwt.client.core.DataClass

  `factoryCreated, factoryProperties`

  ### Fields inherited from class com.smartgwt.client.core.JsObject

  `jsObj`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CreateScreenSettings()`
  `CreateScreenSettings(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `getAllowPlaceholders()`
  Should Placeholders be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.
  `Map`
  `getClassSubstitutions()`
  Maps class names of widgets in the screen to new class names, so that if a widget would normally be constructed as an instance of a class, and that class is in the map, it's instead constructed as an instance of the new class.
  `Boolean`
  `getClobberDataSources()`
  Should DataSources referenced by the screen clobber existing, globally-bound DataSources on the client when the screen is created? The default of false means that any DataSources defined in the screen will be discarded if they collide with existing, globally-bound DataSources.
  `Map`
  `getComponentSubstitutions()`
  Defines the map of new widget ids to existing class instances, or to new instances that will be of a different class.
  `DataContext`
  `getDataContext()`
  `DataContext` that will be provided to the top-level component as `dataContext` in the screen.
  `Element`
  `getHtmlElement()`
  Simplifies integrating a screen with an existing JavaScript app.
  `String`
  `getHtmlElementAsString()`
  Simplifies integrating a screen with an existing JavaScript app.
  `static CreateScreenSettings`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `Boolean`
  `getSuppressAutoDraw()`
  If true, prevents any screen from being drawn when it's created, even if there's an explicit `Canvas.autoDraw`:true setting on it.
  `Boolean`
  `getVerifyAsError()`
  Enable `verifyAsError` behavior only for requests using these settings.
  `Map<String,String>`
  `getVerifyComponents()`
  Enables verification that the created screen contains a component having a `localId` equal to the given key, and that it is an instance (or subclass) if the key's value.
  `CreateScreenSettings`
  `setAllowPlaceholders(Boolean allowPlaceholders)`
  Should Placeholders be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.
  `CreateScreenSettings`
  `setClassSubstitutions(Map classSubstitutions)`
  Maps class names of widgets in the screen to new class names, so that if a widget would normally be constructed as an instance of a class, and that class is in the map, it's instead constructed as an instance of the new class.
  `CreateScreenSettings`
  `setClobberDataSources(Boolean clobberDataSources)`
  Should DataSources referenced by the screen clobber existing, globally-bound DataSources on the client when the screen is created? The default of false means that any DataSources defined in the screen will be discarded if they collide with existing, globally-bound DataSources.
  `CreateScreenSettings`
  `setComponentSubstitutions(Map componentSubstitutions)`
  Defines the map of new widget ids to existing class instances, or to new instances that will be of a different class.
  `CreateScreenSettings`
  `setDataContext(DataContext dataContext)`
  `DataContext` that will be provided to the top-level component as `dataContext` in the screen.
  `CreateScreenSettings`
  `setHtmlElement(Element htmlElement)`
  Simplifies integrating a screen with an existing JavaScript app.
  `CreateScreenSettings`
  `setHtmlElement(String htmlElement)`
  Simplifies integrating a screen with an existing JavaScript app.
  `CreateScreenSettings`
  `setSuppressAutoDraw(Boolean suppressAutoDraw)`
  If true, prevents any screen from being drawn when it's created, even if there's an explicit `Canvas.autoDraw`:true setting on it.
  `CreateScreenSettings`
  `setVerifyAsError(Boolean verifyAsError)`
  Enable `verifyAsError` behavior only for requests using these settings.
  `CreateScreenSettings`
  `setVerifyComponents(Map<String,String> verifyComponents)`
  Enables verification that the created screen contains a component having a `localId` equal to the given key, and that it is an instance (or subclass) if the key's value.

  ### Methods inherited from class com.smartgwt.client.core.DataClass

  `applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated`

  ### Methods inherited from class com.smartgwt.client.core.JsObject

  `equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CreateScreenSettings

    public CreateScreenSettings()

  - ### CreateScreenSettings

    public CreateScreenSettings(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static CreateScreenSettings getOrCreateRef(JavaScriptObject jsObj)

  - ### setAllowPlaceholders

    public CreateScreenSettings setAllowPlaceholders(Boolean allowPlaceholders)
    Should Placeholders be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.
    Parameters:
      `allowPlaceholders` - New allowPlaceholders value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls

  - ### getAllowPlaceholders

    public Boolean getAllowPlaceholders()
    Should Placeholders be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.
    Returns:
      Current allowPlaceholders value. Default value is null

  - ### setClassSubstitutions

    public CreateScreenSettings setClassSubstitutions(Map classSubstitutions)
    Maps class names of widgets in the screen to new class names, so that if a widget would normally be constructed as an instance of a class, and that class is in the map, it's instead constructed as an instance of the new class.
    Parameters:
      `classSubstitutions` - New classSubstitutions value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### getClassSubstitutions

    public Map getClassSubstitutions()
    Maps class names of widgets in the screen to new class names, so that if a widget would normally be constructed as an instance of a class, and that class is in the map, it's instead constructed as an instance of the new class.
    Returns:
      Current classSubstitutions value. Default value is null
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### setClobberDataSources

    public CreateScreenSettings setClobberDataSources(Boolean clobberDataSources)
    Should DataSources referenced by the screen clobber existing, globally-bound DataSources on the client when the screen is created? The default of false means that any DataSources defined in the screen will be discarded if they collide with existing, globally-bound DataSources.

    Note that here we consider a DataSource to be "globally bound" if it can be retrieved by ID using the method `DataSource.get()`, regardless of whether it's actually bound to the browser `window` object.

    Parameters:
      `clobberDataSources` - New clobberDataSources value. Default value is false
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls

  - ### getClobberDataSources

    public Boolean getClobberDataSources()
    Should DataSources referenced by the screen clobber existing, globally-bound DataSources on the client when the screen is created? The default of false means that any DataSources defined in the screen will be discarded if they collide with existing, globally-bound DataSources.

    Note that here we consider a DataSource to be "globally bound" if it can be retrieved by ID using the method `DataSource.get()`, regardless of whether it's actually bound to the browser `window` object.

    Returns:
      Current clobberDataSources value. Default value is false

  - ### setComponentSubstitutions

    public CreateScreenSettings setComponentSubstitutions(Map componentSubstitutions)
    Defines the map of new widget ids to existing class instances, or to new instances that will be of a different class. A substituted class instance is returned immediately from Class.create() without modification. Otherwise, the constructor for the new instance is run, but targeting the substituted class rather than the original.

    Note that where we return an existing instance, not even its `Canvas.ID` will be changed. An alternative is programmtic replacement using `Layout.replaceMember()`.

    Parameters:
      `componentSubstitutions` - New componentSubstitutions value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### getComponentSubstitutions

    public Map getComponentSubstitutions()
    Defines the map of new widget ids to existing class instances, or to new instances that will be of a different class. A substituted class instance is returned immediately from Class.create() without modification. Otherwise, the constructor for the new instance is run, but targeting the substituted class rather than the original.

    Note that where we return an existing instance, not even its `Canvas.ID` will be changed. An alternative is programmtic replacement using `Layout.replaceMember()`.

    Returns:
      Current componentSubstitutions value. Default value is null
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### setDataContext

    public CreateScreenSettings setDataContext(DataContext dataContext)
    `DataContext` that will be provided to the top-level component as `dataContext` in the screen.

    To understand how `dataContext` is used to automatically populate `DataBoundComponents`, see `Canvas.autoPopulateData`.

    Parameters:
      `dataContext` - New dataContext value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls

  - ### getDataContext

    public DataContext getDataContext()
    `DataContext` that will be provided to the top-level component as `dataContext` in the screen.

    To understand how `dataContext` is used to automatically populate `DataBoundComponents`, see `Canvas.autoPopulateData`.

    Returns:
      Current dataContext value. Default value is null

  - ### setHtmlElement

    public CreateScreenSettings setHtmlElement(Element htmlElement)
    Simplifies integrating a screen with an existing JavaScript app. Does the following:
    - Sets `suppressAutoDraw`: true
    - Sets `Canvas.htmlElement` of the screen's top widget to the DOM element
    - Sets the screen's top widget to have `Canvas.position`: "relative"
    - Draws the screen by calling `Canvas.draw()` on the top widget
    If you need to apply additional, custom configuration, for example setting `Canvas.htmlPosition`, then instead of using this property, you can call `RPCManager.createScreen()` with `suppressAutoDraw`: true, and then manually configure and draw the screen:

              CreateScreenSettings settings = new CreateScreenSettings();
              settings.setSuppressAutoDraw(true);
              Canvas screen = RPCManager.createScreen("My Screen", settings);
              screen.setHtmlElement(element);
              screen.setHtmlPosition(DrawPosition.REPLACE);
              screen.setPosition(Positioning.RELATIVE);
              screen.draw();

    Parameters:
      `htmlElement` - New htmlElement value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls

  - ### getHtmlElement

    public Element getHtmlElement()
    Simplifies integrating a screen with an existing JavaScript app. Does the following:
    - Sets `suppressAutoDraw`: true
    - Sets `Canvas.htmlElement` of the screen's top widget to the DOM element
    - Sets the screen's top widget to have `Canvas.position`: "relative"
    - Draws the screen by calling `Canvas.draw()` on the top widget
    If you need to apply additional, custom configuration, for example setting `Canvas.htmlPosition`, then instead of using this property, you can call `RPCManager.createScreen()` with `suppressAutoDraw`: true, and then manually configure and draw the screen:

              CreateScreenSettings settings = new CreateScreenSettings();
              settings.setSuppressAutoDraw(true);
              Canvas screen = RPCManager.createScreen("My Screen", settings);
              screen.setHtmlElement(element);
              screen.setHtmlPosition(DrawPosition.REPLACE);
              screen.setPosition(Positioning.RELATIVE);
              screen.draw();

    Returns:
      Current htmlElement value. Default value is null

  - ### setHtmlElement

    public CreateScreenSettings setHtmlElement(String htmlElement)
    Simplifies integrating a screen with an existing JavaScript app. Does the following:
    - Sets `suppressAutoDraw`: true
    - Sets `Canvas.htmlElement` of the screen's top widget to the DOM element
    - Sets the screen's top widget to have `Canvas.position`: "relative"
    - Draws the screen by calling `Canvas.draw()` on the top widget
    If you need to apply additional, custom configuration, for example setting `Canvas.htmlPosition`, then instead of using this property, you can call `RPCManager.createScreen()` with `suppressAutoDraw`: true, and then manually configure and draw the screen:

              CreateScreenSettings settings = new CreateScreenSettings();
              settings.setSuppressAutoDraw(true);
              Canvas screen = RPCManager.createScreen("My Screen", settings);
              screen.setHtmlElement(element);
              screen.setHtmlPosition(DrawPosition.REPLACE);
              screen.setPosition(Positioning.RELATIVE);
              screen.draw();

    Parameters:
      `htmlElement` - New htmlElement value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls

  - ### getHtmlElementAsString

    public String getHtmlElementAsString()
    Simplifies integrating a screen with an existing JavaScript app. Does the following:
    - Sets `suppressAutoDraw`: true
    - Sets `Canvas.htmlElement` of the screen's top widget to the DOM element
    - Sets the screen's top widget to have `Canvas.position`: "relative"
    - Draws the screen by calling `Canvas.draw()` on the top widget
    If you need to apply additional, custom configuration, for example setting `Canvas.htmlPosition`, then instead of using this property, you can call `RPCManager.createScreen()` with `suppressAutoDraw`: true, and then manually configure and draw the screen:

              CreateScreenSettings settings = new CreateScreenSettings();
              settings.setSuppressAutoDraw(true);
              Canvas screen = RPCManager.createScreen("My Screen", settings);
              screen.setHtmlElement(element);
              screen.setHtmlPosition(DrawPosition.REPLACE);
              screen.setPosition(Positioning.RELATIVE);
              screen.draw();

    Returns:
      Current htmlElement value. Default value is null

  - ### setSuppressAutoDraw

    public CreateScreenSettings setSuppressAutoDraw(Boolean suppressAutoDraw)
    If true, prevents any screen from being drawn when it's created, even if there's an explicit `Canvas.autoDraw`:true setting on it.
    Parameters:
      `suppressAutoDraw` - New suppressAutoDraw value. Default value is false
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls

  - ### getSuppressAutoDraw

    public Boolean getSuppressAutoDraw()
    If true, prevents any screen from being drawn when it's created, even if there's an explicit `Canvas.autoDraw`:true setting on it.
    Returns:
      Current suppressAutoDraw value. Default value is false

  - ### setVerifyAsError

    public CreateScreenSettings setVerifyAsError(Boolean verifyAsError)
    Enable `verifyAsError` behavior only for requests using these settings.
    Parameters:
      `verifyAsError` - New verifyAsError value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls
    See Also:
      - `setVerifyAsError(java.lang.Boolean)`
      - `LoadProjectSettings.setVerifyAsError(java.lang.Boolean)`

  - ### getVerifyAsError

    public Boolean getVerifyAsError()
    Enable `verifyAsError` behavior only for requests using these settings.
    Returns:
      Current verifyAsError value. Default value is null
    See Also:
      - `getVerifyAsError()`
      - `LoadProjectSettings.getVerifyAsError()`

  - ### setVerifyComponents

    public CreateScreenSettings setVerifyComponents(Map<String,String> verifyComponents)
    Enables verification that the created screen contains a component having a `localId` equal to the given key, and that it is an instance (or subclass) if the key's value. Example:

            {'customerListGrid: 'ListGrid'}

    You may verify presence and type of Tabs, SectionStackSections, and FormItems by providing their names following the parent component's id in dot-separated notation. Example:

            {
              'mainTabSet.customersTab': 'ImgTab',
              'mainSectionStack.customersSection': 'SectionHeader',
              'customerDetailsForm.customerNameItem': 'TextItem'
            }

    Findings are always reported to the console, and may also be presented to the user with a warning dialog by setting `verifyAsError` or `verifyAsError`.
    Parameters:
      `verifyComponents` - New verifyComponents value. Default value is null
    Returns:
      `CreateScreenSettings` instance, for chaining setter calls
    See Also:
      - `RPCManager.createScreen(java.lang.String)`

  - ### getVerifyComponents

    public Map<String,String> getVerifyComponents()
    Enables verification that the created screen contains a component having a `localId` equal to the given key, and that it is an instance (or subclass) if the key's value. Example:

            {'customerListGrid: 'ListGrid'}

    You may verify presence and type of Tabs, SectionStackSections, and FormItems by providing their names following the parent component's id in dot-separated notation. Example:

            {
              'mainTabSet.customersTab': 'ImgTab',
              'mainSectionStack.customersSection': 'SectionHeader',
              'customerDetailsForm.customerNameItem': 'TextItem'
            }

    Findings are always reported to the console, and may also be presented to the user with a warning dialog by setting `verifyAsError` or `verifyAsError`.
    Returns:
      Current verifyComponents value. Default value is null
    See Also:
      - `RPCManager.createScreen(java.lang.String)`