Class CreateScreenSettings
- All Implemented Interfaces:
HasHandlers
RPCManager.createScreen()
. Classes and instances can be mapped
(constructed as) other classes, and existing widget instances can be returned for new ones.-
Field Summary
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionShould Placeholders be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.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.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.Defines the map of new widget ids to existing class instances, or to new instances that will be of a different class.DataContext
that will be provided to the top-level component asdataContext
in the screen.Simplifies integrating a screen with an existing JavaScript app.Simplifies integrating a screen with an existing JavaScript app.static CreateScreenSettings
getOrCreateRef
(JavaScriptObject jsObj) If true, prevents any screen from being drawn when it's created, even if there's an explicitCanvas.autoDraw
:true setting on it.EnableverifyAsError
behavior only for requests using these settings.Enables verification that the created screen contains a component having alocalId
equal to the given key, and that it is an instance (or subclass) if the key's value.setAllowPlaceholders
(Boolean allowPlaceholders) Should Placeholders be rendered as placeholders? If property is not set actual components are created instead of the Placeholders.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.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.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.setDataContext
(DataContext dataContext) DataContext
that will be provided to the top-level component asdataContext
in the screen.setHtmlElement
(Element htmlElement) Simplifies integrating a screen with an existing JavaScript app.setHtmlElement
(String htmlElement) Simplifies integrating a screen with an existing JavaScript app.setSuppressAutoDraw
(Boolean suppressAutoDraw) If true, prevents any screen from being drawn when it's created, even if there's an explicitCanvas.autoDraw
:true setting on it.setVerifyAsError
(Boolean verifyAsError) EnableverifyAsError
behavior only for requests using these settings.setVerifyComponents
(Map<String, String> verifyComponents) Enables verification that the created screen contains a component having alocalId
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
-
Constructor Details
-
CreateScreenSettings
public CreateScreenSettings() -
CreateScreenSettings
-
-
Method Details
-
getOrCreateRef
-
setAllowPlaceholders
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
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
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
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
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 browserwindow
object.- Parameters:
clobberDataSources
- New clobberDataSources value. Default value is false- Returns:
CreateScreenSettings
instance, for chaining setter calls
-
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 browserwindow
object.- Returns:
- Current clobberDataSources value. Default value is false
-
setComponentSubstitutions
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 usingLayout.replaceMember()
.- Parameters:
componentSubstitutions
- New componentSubstitutions value. Default value is null- Returns:
CreateScreenSettings
instance, for chaining setter calls- See Also:
-
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 usingLayout.replaceMember()
.- Returns:
- Current componentSubstitutions value. Default value is null
- See Also:
-
setDataContext
DataContext
that will be provided to the top-level component asdataContext
in the screen.To understand how
dataContext
is used to automatically populateDataBoundComponents
, seeCanvas.autoPopulateData
.- Parameters:
dataContext
- New dataContext value. Default value is null- Returns:
CreateScreenSettings
instance, for chaining setter calls
-
getDataContext
DataContext
that will be provided to the top-level component asdataContext
in the screen.To understand how
dataContext
is used to automatically populateDataBoundComponents
, seeCanvas.autoPopulateData
.- Returns:
- Current dataContext value. Default value is null
-
setHtmlElement
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
Canvas.htmlPosition
, then instead of using this property, you can callRPCManager.createScreen()
withsuppressAutoDraw
: 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
- Sets
-
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
Canvas.htmlPosition
, then instead of using this property, you can callRPCManager.createScreen()
withsuppressAutoDraw
: 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
- Sets
-
setHtmlElement
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
Canvas.htmlPosition
, then instead of using this property, you can callRPCManager.createScreen()
withsuppressAutoDraw
: 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
- Sets
-
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
Canvas.htmlPosition
, then instead of using this property, you can callRPCManager.createScreen()
withsuppressAutoDraw
: 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
- Sets
-
setSuppressAutoDraw
If true, prevents any screen from being drawn when it's created, even if there's an explicitCanvas.autoDraw
:true setting on it.- Parameters:
suppressAutoDraw
- New suppressAutoDraw value. Default value is false- Returns:
CreateScreenSettings
instance, for chaining setter calls
-
getSuppressAutoDraw
If true, prevents any screen from being drawn when it's created, even if there's an explicitCanvas.autoDraw
:true setting on it.- Returns:
- Current suppressAutoDraw value. Default value is false
-
setVerifyAsError
EnableverifyAsError
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
EnableverifyAsError
behavior only for requests using these settings.- Returns:
- Current verifyAsError value. Default value is null
- See Also:
-
setVerifyComponents
Enables verification that the created screen contains a component having alocalId
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 settingverifyAsError
orverifyAsError
.- Parameters:
verifyComponents
- New verifyComponents value. Default value is null- Returns:
CreateScreenSettings
instance, for chaining setter calls- See Also:
-
getVerifyComponents
Enables verification that the created screen contains a component having alocalId
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 settingverifyAsError
orverifyAsError
.- Returns:
- Current verifyComponents value. Default value is null
- See Also:
-