iframe
iframe embeds an HTML page or document into the current page.
XML Element |
|
|---|---|
Java Class |
|
Basics
The following example demonstrates basic iframe usage.
<iframe width="100%" height="100%" css="border: unset;"
resource="https://en.wikipedia.org/wiki/Parrot"/>
Displaying Documents
Set resource to the application path of a static document. The example embeds a PDF served from the application’s resources:
<layout>
<iframe width="100%" height="100%" css="border: unset;"
resource="pdf/tutorial.pdf"/>
</layout>
Related samples demonstrate documents produced dynamically or loaded through REST:
Inline HTML Content
Set resourceDoc to escaped HTML markup when the frame should render content supplied directly by the view descriptor:
<iframe resourceDoc="<h1>Awesome!<h1/>"/>
Attributes
Common attributes serve the same purpose for all components.
The following attributes are specific to iframe:
| Name | Description | Default |
|---|---|---|
Sets a Permissions Policy for features available to the embedded content. |
— |
|
Tells the browser how critical the resource is for rendering the page: |
|
|
Sets the name of the embedded browsing context, which can be used as a link or form target. |
— |
|
Specifies the path to the static resource such as |
— |
|
Sets escaped inline HTML content. See Inline HTML Content. |
— |
|
Restricts capabilities of the embedded content. Specify comma-separated |
— |
Handlers
| Name | Description |
|---|---|
Fires when the frame is attached to the UI. |
|
Fires when the frame is detached from the UI. |