Open external URL
See also Open external URL (for Event handling) or the ribbon macro command 'Open external URL' (see Available commands).
Actions – Abstract
The Open external URL action opens a URL passed as input value ($input) in a new tab of the client browser.
The Open external URL action opens a URL passed as input value ($input) in a new tab of the client browser.
The newly opened browser tab immediately receives the focus.
The form does not wait until the called page is established. Any subsequent actions are executed immediately.
As far as errors occur when opening the URL, they will be displayed in the corresponding browser tab. But they have no influence on the form.
Configuration
The action does not provide any parameters. The URL must be provided directly as an input value ($input).
A simple way to specify a concrete URL is to use the Calculate Behaviour type (see examples below). This can be used for static assignments ('literals' as an expression), but also offers the possibility to build up the URL dynamically per 'calculation expression' (see examples).
►IMPORTANT◄ The input value ($input) must be a string, otherwise no browser tab will be opened. Unlike other Lobster Data Platform / Orchestration (see also Open external URL), there is no automatic conversion of other data types (e.g. long or object) to a string.
Before being passed to the browser tab, the string is trimmed, i.e. 'separated' from any introductory or trailing whitespace characters (spaces, line breaks, etc.).
If the URL does not specify a specific protocol (e.g. http:), the passed text is interpreted as a relative path in the context of the Lobster Data Platform / Orchestration client (see examples).
►NOTE◄ A link to a target element is ineffective!
Examples
Simple use case with static URL
Within various forms, the 'Terms and Conditions' (TsCs) should be able to be displayed by clicking on a button. For this purpose, every time the TsCs are updated, a PDF document is created and uploaded by an authorized user with the File manager to a specific subdirectory in the web folder of Lobster Data Platform / Orchestration. The specially created subdirectory public/documents and the file name agb.pdf will always be used:
By definition, all content placed within the web folder is available as 'subpages' of the client URL.
For access to the TsCs document, the following path is sufficient as 'URL' when accessing from a client form:
public/documents/tscs.pdf
Configuration:
In each form that should grant access to the TsCs document, a corresponding Button is placed and equipped with the Behaviour shown on the right:
|
|
Simple use case with 'calculated' URL
Based on the previous use case, it should now be achieved that either the German document agb.pdf or the English version tscs.pdf ('Terms and Conditions') is opened in a specific session, depending on the logon language.
The Localization offers itself to define for each logon language whether the German or the English document should be displayed. Specifically, a custom localization entry is created for this purpose:
As 'Localization' for the localization entry 'publicDocuments/TERMS_AND_CONDITIONS' different file names can be stored per logon language as shown in the image.
In the configuration from the previous example, only the Calculation expression in the Behaviour type Calculate must then be adjusted so that the URL is established appropriately:
Per notation [Bundle, Resource] the variable 'language entry' can be attached directly to the unified base path public/documents.
At runtime, the document assigned via the Localization for the Current locale will always appear when the Button is pressed.
►NOTE◄ Company specific localization could be used in this context to display not only language-specific but also company-specific documents within a more complex company hierarchy always using the same TsCs button.
More complex use case
A portal should forward a search term entered by the user to a company website (here: www.lobster-world.com) and display the search result in a newly opened browser tab.
The Lobster home page supports this access using the following syntax: www.lobster-world.com/<language>//?s=<searchText>.
The <language> placeholder must be replaced with a two-character abbreviation for one of the languages supported on the website, e.g. 'de' for German or 'en' for English.
The term to be searched for must be passed as the value for the s URL parameter.
Configuration:
In the portal, a Text field for entering the search term and a Combobox for selecting the Locale for the 'Search' are configured as shown on the right. Two behaviours are set up for the Text field (element #14). The first behaviour 'Enter' triggers the second behaviour 'openURL' when pressing the 'Enter' key in the search field. The configuration for the 'openURL' behaviour is expanded on the right. Within the Behaviour type Calculate, the Calculation expression is used to build the target URL from the following components:
Among the Actions on "True", the Open external URL is added, which does not require any specific parameterization. |
|