X4 Produktdokumentation

ExternalWeb Component

An ExternalWeb Component embeds an external Web page in a Web App. An ExternalWeb component is created with the <ExternalWebComponent> element in the .wad file or in a master/detail component (.masterdetail file).

Note:

  • If the Web page owner prohibits embedding, for example by including an appropriate HTTP response header, that Web page cannot be embedded in a Web App.

  • Please note that embedded web pages can store and use cookies on the device.

Defining the attributes of the ExternalWeb Component

Note:

Depending on whether you create the <ExternalWebComponent> element in the .wad file or in a master/detail component (.masterdetail file), you can define different attributes. For detailed information about the attributes that you can define in a .wad file for the ExternalWeb Component, see Referencing Components in the Web App Definition .

If you create the ExternalWeb Component in a .masterdetail file, you can define the following attributes:

Attribute

Description

allowForms

Allows embedded content to submit forms.

Possible values:

  • true

  • false (default)

allowModals

Allows embedded content to display a modal dialog.

Possible values:

  • true

  • false (default)

allowPointerLock

Allows embedded content to interpret mouse movements directly as an input method.

Possible values:

  • true

  • false (default)

allowPopups

Allows embedded content to open a web page in a new window or tab.

Possible values:

  • true

  • false (default)

allowSameOrigin

Allows embedded content to share space when the source of embedded content is the same as the source of the host web application.

Possible values:

  • true

  • false (default)

allowScripts

Allows embedded content to run JavaScript.

Possible values:

  • true

  • false (default)

allowTopNavigation

Allows embedded content to open a web page in the same window or tab.

Possible values:

  • true

  • false (default)

name

Unique name that references the component.

Possible values:

Any string

process

Repository path to a Technical Process

Possible values:

Any path in the X4 repository without leading slash (e.g. Project/Folder/Process.wrf)

Note:

The process attribute cannot be used at the same time as the url attribute.

title

Title of the component. Appears as a header in the component.

  • Data binding possible

Possible values:

Any string with the title of the component

titleBackground

Defines a title background color.

Possible values:

  • Hexadecimal color value, e.g. ff5a00

Note:

Do not use a hash before the color value, and do not use a shortened notation for the color value!

  • Color code from the color palette of the Web App (cf. Theming), e.g. A200

Note:

Do not use a hash before the color value, and do not use a shortened notation for the color value!

titleForeground

Defines a color for the title foreground.

Possible values:

  • Hexadecimal color value, e.g. ff5a00

Note:

Do not use a hash before the color value, and do not use a shortened notation for the color value!

  • Color code from the color palette of the Web App (cf. Theming), e.g. A200

url

Uniform Resource Locator (URL) with any valid protocol (http://, https://, etc.)

Possible values:

Any valid URL (e.g. https://www.softproject.de/)

Note:

The url attribute cannot be used at the same time as the process attribute.

visible

Defines the visibility.

  • Data binding (Boolean) possible

Possible values:

Boolean or string for data binding

Input

If the process parameter has been set, an XML file with the URL as input in the following structure is expected:

XML
<?xml version="1.0" encoding="UTF-8"?>
<Ok
	url="URL"/>

Example

URL in ExternalWeb Component

The following example in the .wad creates an ExternalWeb Component:

XML
<ExternalWebComponent 
	path="ExternalWebUrl"
	displayName="SoftProject Website"
	url="https://www.softproject.de" />

URL via Technical Process

The following example in the .wad creates an ExternalWeb Component:

XML
<ExternalWebComponent 
	path="ExternalWebUrl"
	displayName="SoftProject Website"
	process="provideURL.wrf" />

The Technical Process provideURL.wrf provides the following output that specifies the URL:

XML
<?xml version="1.0" encoding="UTF-8"?>
<Ok
	url="https://www.softproject.de"/>