Class 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:
  • 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:
    • 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:
    • 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:
    • 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:
    • 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: 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: 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: 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: 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:
    • getVerifyAsError

      public Boolean getVerifyAsError()
      Enable verifyAsError behavior only for requests using these settings.
      Returns:
      Current verifyAsError value. Default value is null
      See Also:
    • 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:
    • 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: