Class HTMLFlow

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasContentLoadedHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers
Direct Known Subclasses:
HTMLPane

public class HTMLFlow extends Canvas implements HasContentLoadedHandlers
Use the HTMLFlow component to display HTML content that should expand to its natural size without scrolling.

HTML content can be specified directly via contents, or loaded from a URL via the property contentsURL. This method of loading is for simple HTML content only; Smart GWT components should be loaded via the ViewLoader class.

HTMLFlows are typically used to render snippets of HTML directly in the document rather than holding a complete HTML page, as the component can only size to fit HTML content it renders directly into the DOM. If you are looking to display a complete HTML page, you will need to modify the default Overflow and defaultHeight, or use the HTMLPane class

NOTE: Since the size of an HTMLFlow component is determined by its HTML contents, this component will draw at varying sizes if given content of varying size. When using HTMLFlow components within a Layout, consider what will happen if the HTMLFlow renders at various sizes. An HTMLFlow which can expand should be placed in a container where other components can render smaller, where the container is allowed to scroll, or where there is padding to expand into.

HTMLFlow is a DataBoundComponent but only supports one method at this time, fetchRelatedData.

See Also:
  • Constructor Details

    • HTMLFlow

      public HTMLFlow()
    • HTMLFlow

      public HTMLFlow(JavaScriptObject jsObj)
    • HTMLFlow

      public HTMLFlow(String contents)
  • Method Details

    • getOrCreateRef

      public static HTMLFlow getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class Canvas
    • setAllowCaching

      public HTMLFlow setAllowCaching(Boolean allowCaching) throws IllegalStateException
      By default an HTMLFlow will explicitly prevent browser caching.

      Set to true to allow browser caching if the browser would normally do so, in other words, if the HTTP headers returned with the response indicate that the response can be cached.

      Parameters:
      allowCaching - New allowCaching value. Default value is false
      Returns:
      HTMLFlow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getAllowCaching

      public Boolean getAllowCaching()
      By default an HTMLFlow will explicitly prevent browser caching.

      Set to true to allow browser caching if the browser would normally do so, in other words, if the HTTP headers returned with the response indicate that the response can be cached.

      Returns:
      Current allowCaching value. Default value is false
    • setAutoChangeProtocol

      public HTMLFlow setAutoChangeProtocol(Boolean autoChangeProtocol)
      If this component is passed a URL with a protocol that differs from the current page, should it be automatically changed to match the page?
      Parameters:
      autoChangeProtocol - New autoChangeProtocol value. Default value is true
      Returns:
      HTMLFlow instance, for chaining setter calls
    • getAutoChangeProtocol

      public Boolean getAutoChangeProtocol()
      If this component is passed a URL with a protocol that differs from the current page, should it be automatically changed to match the page?
      Returns:
      Current autoChangeProtocol value. Default value is true
    • setAutoDeriveContentsType

      public HTMLFlow setAutoDeriveContentsType(boolean autoDeriveContentsType)
      If ContentsType is not explicitly specified, should it be automatically derived?

      If set to true, this component will use isPageHTML() to determine whether the contents are a standalone HTML page which should be rendered into an embedded IFRAME rather than written directly into the component's handle in the DOM.

      Note that this property will auto derive the appropriate contents type for both explicitly specified contents and for HTML loaded from the contentsURL

      See ContentsType for further information on displaying complete HTML pages in an IFRAME.

      Parameters:
      autoDeriveContentsType - New autoDeriveContentsType value. Default value is false
      Returns:
      HTMLFlow instance, for chaining setter calls
    • getAutoDeriveContentsType

      public boolean getAutoDeriveContentsType()
      If ContentsType is not explicitly specified, should it be automatically derived?

      If set to true, this component will use isPageHTML() to determine whether the contents are a standalone HTML page which should be rendered into an embedded IFRAME rather than written directly into the component's handle in the DOM.

      Note that this property will auto derive the appropriate contents type for both explicitly specified contents and for HTML loaded from the contentsURL

      See ContentsType for further information on displaying complete HTML pages in an IFRAME.

      Returns:
      Current autoDeriveContentsType value. Default value is false
    • setCanSelectText

      public HTMLFlow setCanSelectText(Boolean canSelectText) throws IllegalStateException
      Text selection for copy and paste is enabled by default in the HTMLFlow class. Note that this setting has no impact if ContentsType is set to ContentsType.PAGE. In this case contents is loaded from a target URL via an IFRAME element, and text selection behavior will be dictated by the loaded HTML.
      Overrides:
      setCanSelectText in class Canvas
      Parameters:
      canSelectText - New canSelectText value. Default value is true
      Returns:
      HTMLFlow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCanSelectText

      public Boolean getCanSelectText()
      Text selection for copy and paste is enabled by default in the HTMLFlow class. Note that this setting has no impact if ContentsType is set to ContentsType.PAGE. In this case contents is loaded from a target URL via an IFRAME element, and text selection behavior will be dictated by the loaded HTML.
      Overrides:
      getCanSelectText in class Canvas
      Returns:
      Current canSelectText value. Default value is true
    • setCaptureSCComponents

      public HTMLFlow setCaptureSCComponents(Boolean captureSCComponents) throws IllegalStateException
      If true, Smart GWT components created while executing the loaded HTML are captured for rendering inside the HTMLFlow.

      Only applies when contentsType is not "page".

      Parameters:
      captureSCComponents - New captureSCComponents value. Default value is true
      Returns:
      HTMLFlow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCaptureSCComponents

      public Boolean getCaptureSCComponents()
      If true, Smart GWT components created while executing the loaded HTML are captured for rendering inside the HTMLFlow.

      Only applies when contentsType is not "page".

      Returns:
      Current captureSCComponents value. Default value is true
    • setContents

      public HTMLFlow setContents(String contents)
      String of HTML contents for this component - may be a fragment of HTML to display or a complete HTML page. See contentsType and supportsContentsAsPage.

      To load HTML contents from a URL, use contentsURL instead of this property. If contentsURL is non-null, contents will be ignored.

      If this method is called after the component has been drawn/initialized: Changes the contents of a widget to newContents, an HTML string.

      Overrides:
      setContents in class Canvas
      Parameters:
      contents - an HTML string to be set as the contents of this widget. Default value is " "
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getContents

      public String getContents()
      String of HTML contents for this component - may be a fragment of HTML to display or a complete HTML page. See contentsType and supportsContentsAsPage.

      To load HTML contents from a URL, use contentsURL instead of this property. If contentsURL is non-null, contents will be ignored.

      Overrides:
      getContents in class Canvas
      Returns:
      Current contents value. Default value is " "
      See Also:
    • setContentsType

      public HTMLFlow setContentsType(ContentsType contentsType) throws IllegalStateException
      The contentsType attribute governs whether the contents of this htmlFlow are a fragment of HTML to inserted directly into the DOM, or a complete HTML page to be displayed in an IFRAME. If not explicitly specified, autoDeriveContentsType may be set to automatically determine the appropriate contents type by analyzing the contents of the component. If autoDeriveContentsType is false and contentsType is not explicitly specified, contents will always be assumed to be "fragment".

      HTMLFlow contents may be directly specified or loaded from a specified URL. Note that if supportsContentsAsPage is false and no contentsURL is specified, the contents string will always be assumed to be a fragment, even if ContentsType is explicitly set to "page".

      Note that an HTMLFlow with contentsType:"page" should not be used to load and display a page containing a set of Smart GWT components into the application. To dynamically load Smart GWT components, use ViewLoader, never this mechanism (click here for why).

      Scripting, CSS and scoping considerations for HTMLFlow contents
      The following considerations apply to HTMLFlow contents, whether directly specified or loaded from a contentsURL.

      When contentsType is "page", the HTML content will be rendered as a standalone document using an IFRAME. Use iframeSandbox to specify IFRAME restrictions using the native sandbox attribute. Note that any script (if allowed) will be executed in the scope of the embedded IFRAME window, not the main application window. Similarly, other features like css stylesheets loaded by the HTMLFlow will apply to the IFRAME window only, and the IFRAME will not pick up css style from the main application by default.

      When contentsType is "fragment", if script is encountered within the HTML fragment it will be evaluated in the scope of the main application if evalScriptBlocks is enabled. Developers should be aware that this evaluation occurs as part of the draw/redraw process, but unlike script embedded directly in a static HTML page, it is not processed by the browser while the elements are being written into the DOM and document.write(...) can not be used to modify the HTML as it is being rendered. In this mode, since the contents is written directly into the DOM, standard css styling for the page will be applied.

      Note that if autoDeriveContentsType is enabled, the default set of recognized structuralHTMLTags include <script&gt, so HTML contents including script will display as contentsType:"page". The list of structuralHTMLTags can be modified to exclude script tags if desired.

      Parameters:
      contentsType - New contentsType value. Default value is null
      Returns:
      HTMLFlow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getContentsType

      public ContentsType getContentsType()
      The contentsType attribute governs whether the contents of this htmlFlow are a fragment of HTML to inserted directly into the DOM, or a complete HTML page to be displayed in an IFRAME. If not explicitly specified, autoDeriveContentsType may be set to automatically determine the appropriate contents type by analyzing the contents of the component. If autoDeriveContentsType is false and contentsType is not explicitly specified, contents will always be assumed to be "fragment".

      HTMLFlow contents may be directly specified or loaded from a specified URL. Note that if supportsContentsAsPage is false and no contentsURL is specified, the contents string will always be assumed to be a fragment, even if ContentsType is explicitly set to "page".

      Note that an HTMLFlow with contentsType:"page" should not be used to load and display a page containing a set of Smart GWT components into the application. To dynamically load Smart GWT components, use ViewLoader, never this mechanism (click here for why).

      Scripting, CSS and scoping considerations for HTMLFlow contents
      The following considerations apply to HTMLFlow contents, whether directly specified or loaded from a contentsURL.

      When contentsType is "page", the HTML content will be rendered as a standalone document using an IFRAME. Use iframeSandbox to specify IFRAME restrictions using the native sandbox attribute. Note that any script (if allowed) will be executed in the scope of the embedded IFRAME window, not the main application window. Similarly, other features like css stylesheets loaded by the HTMLFlow will apply to the IFRAME window only, and the IFRAME will not pick up css style from the main application by default.

      When contentsType is "fragment", if script is encountered within the HTML fragment it will be evaluated in the scope of the main application if evalScriptBlocks is enabled. Developers should be aware that this evaluation occurs as part of the draw/redraw process, but unlike script embedded directly in a static HTML page, it is not processed by the browser while the elements are being written into the DOM and document.write(...) can not be used to modify the HTML as it is being rendered. In this mode, since the contents is written directly into the DOM, standard css styling for the page will be applied.

      Note that if autoDeriveContentsType is enabled, the default set of recognized structuralHTMLTags include <script&gt, so HTML contents including script will display as contentsType:"page". The list of structuralHTMLTags can be modified to exclude script tags if desired.

      Returns:
      Current contentsType value. Default value is null
    • setContentsURL

      public HTMLFlow setContentsURL(String contentsURL)
      If specified the HTMLFlow will load its contents from this URL instead of displaying this.contents. May be combined with parameters if contentsURLParams were specified.

      The HTML retrieved from the target URL may be a complete standalone page to be rendered into its own scope using an IFRAME, or a fragment of HTML to display within this component's handle. See ContentsType and autoDeriveContentsType for more information.

      Note that the link{loadingMessage} and httpMethod features only apply if contentsURL was set and contentsType was not explicitly set to "page"

      If this method is called after the component has been drawn/initialized: Change the URL this component loads content from. Triggers a fetch for content from the new URL.

      Can also be called with no arguments to reload content from the existing contentsURL.

      Parameters:
      contentsURL - URL to retrieve contents from. Default value is null
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getContentsURL

      public String getContentsURL()
      If specified the HTMLFlow will load its contents from this URL instead of displaying this.contents. May be combined with parameters if contentsURLParams were specified.

      The HTML retrieved from the target URL may be a complete standalone page to be rendered into its own scope using an IFRAME, or a fragment of HTML to display within this component's handle. See ContentsType and autoDeriveContentsType for more information.

      Note that the link{loadingMessage} and httpMethod features only apply if contentsURL was set and contentsType was not explicitly set to "page"

      Returns:
      Current contentsURL value. Default value is null
      See Also:
    • setContentsURLParams

      public HTMLFlow setContentsURLParams(Map contentsURLParams)
      Parameters to be sent to the contentsURL when fetching content.
      Parameters:
      contentsURLParams - New contentsURLParams value. Default value is null
      Returns:
      HTMLFlow instance, for chaining setter calls
    • setDefaultHeight

      public HTMLFlow setDefaultHeight(int defaultHeight)
      HTMLFlow defaultHeight is set to 1 which, together with overflow:"visible" causes the HTMLFlow to size to its content HTML.

      Note that if ContentsType is "page", overflow:"visible" is not supported - for this usage an explicit larger height should be specified. You may want to use the preconfigured HTMLPane class instead of HTMLFlow for this usage.

      Overrides:
      setDefaultHeight in class Canvas
      Parameters:
      defaultHeight - New defaultHeight value. Default value is 1
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getDefaultHeight

      public int getDefaultHeight()
      HTMLFlow defaultHeight is set to 1 which, together with overflow:"visible" causes the HTMLFlow to size to its content HTML.

      Note that if ContentsType is "page", overflow:"visible" is not supported - for this usage an explicit larger height should be specified. You may want to use the preconfigured HTMLPane class instead of HTMLFlow for this usage.

      Overrides:
      getDefaultHeight in class Canvas
      Returns:
      Current defaultHeight value. Default value is 1
      See Also:
    • setDefaultWidth

      public HTMLFlow setDefaultWidth(int defaultWidth)
      For custom components, establishes a default width for the component.

      For a component that should potentially be sized automatically by a Layout, set this property rather than width directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.

      Overrides:
      setDefaultWidth in class Canvas
      Parameters:
      defaultWidth - New defaultWidth value. Default value is 200
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getDefaultWidth

      public int getDefaultWidth()
      For custom components, establishes a default width for the component.

      For a component that should potentially be sized automatically by a Layout, set this property rather than width directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.

      Overrides:
      getDefaultWidth in class Canvas
      Returns:
      Current defaultWidth value. Default value is 200
      See Also:
    • setDynamicContents

      public HTMLFlow setDynamicContents(Boolean dynamicContents)
      Dynamic string of HTML contents for this component. As with contents, this may be a fragment of HTML to display or a complete HTML page. See contentsType and supportsContentsAsPage.

      See Canvas.dynamicContents for details on how dynamicContents are resolved to a final string value.

      Note : This is an advanced setting

      Overrides:
      setDynamicContents in class Canvas
      Parameters:
      dynamicContents - New dynamicContents value. Default value is false
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getDynamicContents

      public Boolean getDynamicContents()
      Dynamic string of HTML contents for this component. As with contents, this may be a fragment of HTML to display or a complete HTML page. See contentsType and supportsContentsAsPage.

      See Canvas.dynamicContents for details on how dynamicContents are resolved to a final string value.

      Overrides:
      getDynamicContents in class Canvas
      Returns:
      Current dynamicContents value. Default value is false
      See Also:
    • setEvalScriptBlocks

      public HTMLFlow setEvalScriptBlocks(Boolean evalScriptBlocks) throws IllegalStateException
      If evalScriptBlocks is true, HTMLFlow will pre-process the loaded HTML in order to mimic how the HTML would execute if it were loaded as an independent page or loaded via an IFRAME.

      This feature is intended to assist with migrating existing applications to Smart GWT.

      evalScriptBlocks is enabled by default when loading remote content (via contentsURL) and disabled by default for content supplied via setContents().

      Note that, if evalScriptBlocks is false, <SCRIPT> blocks will still be detected and disabled to avoid the inconsistent results across different browsers.

      Only applies when contentsType is not "page".

      Parameters:
      evalScriptBlocks - New evalScriptBlocks value. Default value is null
      Returns:
      HTMLFlow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getEvalScriptBlocks

      public Boolean getEvalScriptBlocks()
      If evalScriptBlocks is true, HTMLFlow will pre-process the loaded HTML in order to mimic how the HTML would execute if it were loaded as an independent page or loaded via an IFRAME.

      This feature is intended to assist with migrating existing applications to Smart GWT.

      evalScriptBlocks is enabled by default when loading remote content (via contentsURL) and disabled by default for content supplied via setContents().

      Note that, if evalScriptBlocks is false, <SCRIPT> blocks will still be detected and disabled to avoid the inconsistent results across different browsers.

      Only applies when contentsType is not "page".

      Returns:
      Current evalScriptBlocks value. Default value is null
    • setHttpMethod

      public HTMLFlow setHttpMethod(SendMethod httpMethod)
      Selects the HTTP method that will be used when fetching content. Valid values are "POST" and "GET".
      Parameters:
      httpMethod - New httpMethod value. Default value is "GET"
      Returns:
      HTMLFlow instance, for chaining setter calls
    • getHttpMethod

      public SendMethod getHttpMethod()
      Selects the HTTP method that will be used when fetching content. Valid values are "POST" and "GET".
      Returns:
      Current httpMethod value. Default value is "GET"
    • setIframeSandbox

      public HTMLFlow setIframeSandbox(String iframeSandbox) throws IllegalStateException
      When using contentsType ContentsType.PAGE, sets the <iframe> sandbox attribute to the provided value.

      Use the value "*ALL*" to cause the "sandbox" attribute to be output with no value (which causes full sandboxing).

      See any HTML reference for other legal values of the "sandbox" attribute, which allow you to remove individual restrictions on the loaded content.

      Note that Smart GWT simply applies the provided value to the generated <iframe> element and cannot fix bugs or differences in sandbox behavior across different browsers.

      Parameters:
      iframeSandbox - New iframeSandbox value. Default value is null
      Returns:
      HTMLFlow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getIframeSandbox

      public String getIframeSandbox()
      When using contentsType ContentsType.PAGE, sets the <iframe> sandbox attribute to the provided value.

      Use the value "*ALL*" to cause the "sandbox" attribute to be output with no value (which causes full sandboxing).

      See any HTML reference for other legal values of the "sandbox" attribute, which allow you to remove individual restrictions on the loaded content.

      Note that Smart GWT simply applies the provided value to the generated <iframe> element and cannot fix bugs or differences in sandbox behavior across different browsers.

      Returns:
      Current iframeSandbox value. Default value is null
    • setLoadingMessage

      public HTMLFlow setLoadingMessage(String loadingMessage)
      HTML to show while content is being fetched, active only if the contentsURL property has been set. Use "${loadingImage}" to include a loading image.

      The loading message will show both during the initial load of content, and during reload if the contents are reloaded or the contentsURL changed. For a first-time only loading message, initialize the contents property instead.

      Note: the loadingMessage is never displayed when contentsType was explicitly specified as "page".

      Parameters:
      loadingMessage - New loadingMessage value. Default value is "&nbsp;${loadingImage}"
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getLoadingMessage

      public String getLoadingMessage()
      HTML to show while content is being fetched, active only if the contentsURL property has been set. Use "${loadingImage}" to include a loading image.

      The loading message will show both during the initial load of content, and during reload if the contents are reloaded or the contentsURL changed. For a first-time only loading message, initialize the contents property instead.

      Note: the loadingMessage is never displayed when contentsType was explicitly specified as "page".

      Returns:
      Current loadingMessage value. Default value is "&nbsp;${loadingImage}"
      See Also:
    • setOverflow

      public HTMLFlow setOverflow(Overflow overflow)
      HTMLFlows are overflow:"visible" by default, allowing them to fit their HTML content.

      Note that if ContentsType is "page", overflow:"visible" is not supported and the overflow will default to "auto" instead

      Overrides:
      setOverflow in class Canvas
      Parameters:
      overflow - New overflow value. Default value is Canvas.VISIBLE
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getOverflow

      public Overflow getOverflow()
      HTMLFlows are overflow:"visible" by default, allowing them to fit their HTML content.

      Note that if ContentsType is "page", overflow:"visible" is not supported and the overflow will default to "auto" instead

      Overrides:
      getOverflow in class Canvas
      Returns:
      Current overflow value. Default value is Canvas.VISIBLE
      See Also:
    • setSelectContentOnSelectAll

      public HTMLFlow setSelectContentOnSelectAll(Boolean selectContentOnSelectAll)
      When this HTMLFlow is focused, causes Ctrl-A / Command-A keypresses to select just the content, as opposed to all content on the screen becoming selected. This HTMLFlow must be focusable in order for this setting to have an effect.

      Not valid with contentsType ContentsType.PAGE.

      Parameters:
      selectContentOnSelectAll - New selectContentOnSelectAll value. Default value is null
      Returns:
      HTMLFlow instance, for chaining setter calls
      See Also:
    • getSelectContentOnSelectAll

      public Boolean getSelectContentOnSelectAll()
      When this HTMLFlow is focused, causes Ctrl-A / Command-A keypresses to select just the content, as opposed to all content on the screen becoming selected. This HTMLFlow must be focusable in order for this setting to have an effect.

      Not valid with contentsType ContentsType.PAGE.

      Returns:
      Current selectContentOnSelectAll value. Default value is null
      See Also:
    • setStructuralHTMLTags

      public HTMLFlow setStructuralHTMLTags(String... structuralHTMLTags)
      List of tags used to determine whether the HTML contents of an HTMLFlow should be rendered with contentsType:"page".

      If an HTML string contains any of these tags not enclosed in either <pre> ... </pre> tags or comments (<!-- ... -->), isPageHTML() will return true.

      The default list of tags are as follows:

      • "!doctype"
      • "html"
      • "head"
      • "body"
      • "style"
      • "link"
      • "script"

      Note : This is an advanced setting

      Parameters:
      structuralHTMLTags - New structuralHTMLTags value. Default value is ["!doctype","html","head","body","style","link","script"]
      Returns:
      HTMLFlow instance, for chaining setter calls
    • getStructuralHTMLTags

      public String[] getStructuralHTMLTags()
      List of tags used to determine whether the HTML contents of an HTMLFlow should be rendered with contentsType:"page".

      If an HTML string contains any of these tags not enclosed in either <pre> ... </pre> tags or comments (<!-- ... -->), isPageHTML() will return true.

      The default list of tags are as follows:

      • "!doctype"
      • "html"
      • "head"
      • "body"
      • "style"
      • "link"
      • "script"
      Returns:
      Current structuralHTMLTags value. Default value is ["!doctype","html","head","body","style","link","script"]
    • setSupportsContentsAsPage

      public HTMLFlow setSupportsContentsAsPage(boolean supportsContentsAsPage)
      Can this component have its contents specified as a complete standalone HTML page to be rendered into an embedded IFRAME?

      If true, if ContentsType is specified as, or derived to be "page", the contents will be rendered into an embedded IFRAME using the srcdoc attribute rather than written directly into the component handle.

      If false, contentsType has no effect unless contents are being loaded from an explicitly specified contentsURL

      Parameters:
      supportsContentsAsPage - New supportsContentsAsPage value. Default value is true
      Returns:
      HTMLFlow instance, for chaining setter calls
    • getSupportsContentsAsPage

      public boolean getSupportsContentsAsPage()
      Can this component have its contents specified as a complete standalone HTML page to be rendered into an embedded IFRAME?

      If true, if ContentsType is specified as, or derived to be "page", the contents will be rendered into an embedded IFRAME using the srcdoc attribute rather than written directly into the component handle.

      If false, contentsType has no effect unless contents are being loaded from an explicitly specified contentsURL

      Returns:
      Current supportsContentsAsPage value. Default value is true
    • addContentLoadedHandler

      public HandlerRegistration addContentLoadedHandler(ContentLoadedHandler handler)
      Add a contentLoaded handler.

      StringMethod fired when content is completely loaded in this htmlFlow. Has no default implementation. Add a notification to fire custom logic when loading completes.

      Notes:

      • A call to this.setContents() will cause this notification to be fired when the contents have been set. If HTMLFlow.evalScriptBlocks is true, and the HTML passed into setContents() contains any <script src=... > tags, this callback will be fired asynchronously once the scripts have been loaded from the server and executed, as well as having the widget content updated
      • When using HTMLFlow.contentsURL, this does not apply to htmlFlows with contentsType set to "page"
      Specified by:
      addContentLoadedHandler in interface HasContentLoadedHandlers
      Parameters:
      handler - the contentLoaded handler
      Returns:
      HandlerRegistration used to remove this handler
    • fetchRelatedData

      public void fetchRelatedData(ListGridRecord record, Canvas schema)
      Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.

      Relationships between DataSources are declared via DataSourceField.foreignKey.

      For example, given two related DataSources "orders" and "orderItems", where we want to fetch the "orderItems" that belong to a given "order". "orderItems" should declare a field that is a foreignKey to the "orders" table (for example, it might be named "orderId" with foreignKey="orders.id"). Then, to load the records related to a given "order", call fetchRelatedData() on the component bound to "orderItems", pass the "orders" DataSource as the "schema" and pass a record from the "orders" DataSource as the "record" argument.

      Note: When you expect a large number of records to be returned it is not recommended to display these in the DetailViewer as it doesn't have the same level of support for large datasets as the ListGrid.

      Parameters:
      record - DataSource record
      schema - schema of the DataSource record, or DataBoundComponent already bound to that schema
      See Also:
    • fetchRelatedData

      public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback)
      See Also:
    • fetchRelatedData

      public void fetchRelatedData(ListGridRecord record, Canvas schema, DSCallback callback, DSRequest requestProperties)
      Based on the relationship between the DataSource this component is bound to and the DataSource specified as the "schema" argument, call fetchData() to retrieve records in this data set that are related to the passed-in record.

      Relationships between DataSources are declared via DataSourceField.foreignKey.

      For example, given two related DataSources "orders" and "orderItems", where we want to fetch the "orderItems" that belong to a given "order". "orderItems" should declare a field that is a foreignKey to the "orders" table (for example, it might be named "orderId" with foreignKey="orders.id"). Then, to load the records related to a given "order", call fetchRelatedData() on the component bound to "orderItems", pass the "orders" DataSource as the "schema" and pass a record from the "orders" DataSource as the "record" argument.

      Note: When you expect a large number of records to be returned it is not recommended to display these in the DetailViewer as it doesn't have the same level of support for large datasets as the ListGrid.

      Parameters:
      record - DataSource record
      schema - schema of the DataSource record, or DataBoundComponent already bound to that schema
      callback - callback to invoke on completion
      requestProperties - additional properties to set on the DSRequest that will be issued
      See Also:
    • isPageHTML

      public boolean isPageHTML(String html)
      Determines whether the html string passed in is source for a standalone HTML page as opposed to an HTML fragment to be added to the DOM.

      Returns true if any structuralHTMLTags are found in the HTML string, outside of HTML comment or <pre> ... </pre> blocks.

      This method is used by autoDeriveContentsType to determine whether the widget contents should be rendered inside an embedded IFRAME.

      Parameters:
      html - HTML string to test
      Returns:
      true if the HTML string contains any structural HTML page elements.
    • loadingContent

      public Boolean loadingContent()
      Returns true if this htmlFlow is currently loading content from the server.
      Note: Does not apply to htmlFlows with contentsType set to "page"
      Returns:
      whether content is currently being loaded
      See Also:
    • transformHTML

      public void transformHTML(String html)
      Override to modify the loaded HTML before it is rendered.
      Parameters:
      html - the html as loaded from the server return (HTML) html to be rendered. See HTMLString
      See Also:
    • setDefaultProperties

      public static void setDefaultProperties(HTMLFlow hTMLFlowProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      hTMLFlowProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(HTMLFlowLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class Canvas