Overview
serverRender enables server-side rendering of complex linked item traversals and computed data using Apache Velocity. When this property is set on a column, the configuration manager automatically forces the column data type to text and sets readOnly to true — the column becomes a read-only text column whose content is generated by the Velocity template each time the grid loads. This pattern is essential for multi-level link traversals, rich-text rendering with embedded images, and any computed display that would be impractical to express with client-side formulas alone.
When
serverRender is set on a column definition, the configuration manager automatically forces the column type to text and sets readOnly to true. You do not need to specify these properties manually. This behavior is enforced server-side and cannot be overridden. Text wrapping inside server-rendered cells is controlled through the styles section of the sheet configuration using standard CSS rules — there is no column-level text-wrapping property.Column Definition Properties
typeProperties Sub-properties
When a server render column is used together with an itemLink-style binding (for example, bindings: task.$item), the same typeProperties block used by link columns applies. These sub-properties control how linked items are resolved before the Velocity template runs.
Velocity Context Variables
TheserverRender script has access to Polarion’s Velocity context. The most commonly used variables for server render columns are:
Velocity Syntax: Property Access vs Method Calls
serverRender accepts both Velocity syntax flavours interchangeably:
- Property access (no parentheses) — chains field navigation directly:
- Method-call syntax (with parentheses) — uses explicit method invocation:
Basic Configuration
A minimal server render column in the sheet configuration:description field as full HTML, preserving formatting, links, and embedded images. The column is automatically read-only.
Common Patterns
Rendering Rich Text Fields with Clickable Links
Rich text fields (description, custom HTML fields) display as plain text in standard columns. UseserverRender to render the full HTML including clickable hyperlinks, text formatting, and colors:
Custom Redirect Links
Construct clickable links that navigate to specific Polarion pages, external URLs, or other risksheet documents:Displaying Indirectly Linked Work Items
For multi-level linked work items (Level 0 -> Level 1 -> Level 2), where you need to traverse intermediate links to display items that are not directly linked to the current row:serverRender expression (risk -> task -> requirement -> testcase). The same #foreach over $item.getLinkedWorkItems() is nested and filtered by linkRole at each level.
Horizontal Line Separators Between Items
When rendering multiple linked items in a single cell, use<hr/> tags to provide visual separation:
Test Execution Records
Use$testManagementService to display the latest test execution result for a work item. $testManagementService.getLastTestRecords($item.getOldApi(), N) returns up to N test records for the current item; $transaction is used to resolve the test run reference:
$item (current work item), $transaction (current Polarion transaction, used to resolve cross-entity references), and $testManagementService (test management service entry point).
Rendering Work Item Attachments
serverRender can iterate the attachments of a work item using the method-call API surface and emit a clickable link for each one. The attachment URL is generated by chaining .url().linkToOpen().toEncodedRelativeUrl(''):
.render().htmlFor().forFrame(), which produces an inline HTML representation suitable for display inside the cell.
Outline Number Sorting
To sort risksheet items by their LiveDoc outline number (so that1.2.10 sorts after 1.2.2), create a server render column that zero-pads each segment of the outline number, then reference the column in the sortBy property:
1.10.1 before 1.2.2. With padding, 0001.0002.0002 correctly sorts before 0001.0010.0001.
Multi-Project Configuration Properties
When defining server render columns that reference configuration properties across multiple projects, use$config Velocity variables. Space-separated project IDs can be referenced with separate $config lookups:
Export Behavior
Server render columns produce HTML in the interactive grid. During exports, this HTML is converted to plain text:The exact HTML-to-text conversion depends on the complexity of your Velocity output. Nested tables, complex CSS, or JavaScript in server render output may not convert cleanly to plain text exports. Test your specific scripts with both Excel and PDF exports.
PDF Export Considerations
When exporting to PDF via custompdfscript.js, server render columns are handled by the renderDataCell function, which detects columns with serverRender defined and applies HTML-to-text stripping. The emptyPlaceholder property (configurable in custom export scripts) controls what text appears for null or empty server render output in the PDF.
Interaction with Other Column Properties
Complete Example
A full sheet configuration demonstrating multiple server render column patterns in an automotive FMEA context:See Also
- Column Type Reference — overview of all available column types
- Calculated Columns — client-side formula alternative to server-side rendering
- Rich Text Fields — rendering rich text content in columns
- Velocity Template Context — full Velocity context variable reference
- Custom Renderer Templates — advanced rendering templates for row headers and cells
- Configuration Properties Index — complete property reference
- Levels Configuration — hierarchical level definitions