enhancement
major
minor
defect
critical
major
minor
Problem
For a string attribute containing a URL, there is no cell display that functions as a clickable external link (new browser tab). Likewise, there is no table action that opens an external URL.
Version: 8.0.0-alpha12, React View Layer (tl-layout-view/tl-layout-react).
Reproduction (Prime)
Links (prime/project/documents.view.xml, table via primeLinks, Link#url column): The URL appears only as text.
Prime: The URL of the selected link is clickable in the detail pane; in the table, it appears as plain text.
Expected Behavior
A cell display or column option labeled “external link,” when clicked, opens the URL in a new tab.
Solution
Cell display as a link. The LinkDisplay element (com.top_logic.layout.view.element) can be attached as a <display> to any table column—whether an attribute column or a calculated column—and as a <nodeContent> to a tree. It displays the value as a link:
- href: TL script via $value that calculates the URL (default: the value as text),
- label: the displayed text (default: the URL),
- tooltip: TL script for the tooltip,
- kind: url (default), email (mailto:), or tel (tel:),
- new-window: whether a web address opens in a new window (default: yes).
The table search finds the cell based on the displayed text. An address that executes a script (javascript:, vbscript:, data:) never becomes a link. The display renders the link using the FieldValue part, including in the MUI theme.
<column attribute="contactEmail">
<display class="com.top_logic.layout.view.element.LinkDisplay" kind="email"/>
</column>
An attribute of an address type (tl.util:URL, EMail, Phone) or with the annotation <input-control> / TextInputControlProvider input-type="URL" appears as a link in forms and tables without any further configuration. For Prime, it is therefore sufficient to annotate Link#url accordingly.
Only links to websites (http, https) open a new window; email and phone links pass the address to the appropriate program without leaving an empty window behind.
“Open URL” action. The action <open-url url="..." new-window="..."/> (OpenUrlAction) opens a URL—which a TL script calculates from the command’s inputs (e.g., from the selected row)—in a new browser tab or in the application window. It can be used as a toolbar command, in the menu, and as a line activation (on-activate). The server sends the URL to the client via the SSE event OpenUrlEvent. If the browser blocks the window (pop-up blocker), the user receives a notification with a link to the URL, which they can then open themselves.
Demo: tl-demo-react, Attributes → Table: Columns Homepage (Annotation), Contact Email (LinkDisplay kind="email"), Web Search (calculated link), and the " Open Homepage" command.