Use Case
You want to control whether users can link upstream items (like Hazards) to a Risk based on a custom field value. For example, a “Link Hazards?” field set to “Yes” enables linking, while “No” makes the link column read-only.Configuration Steps
Step 1: Add a Control Field
First, ensure you have an enum field in Polarion that will control linking behavior. For this example, we’ll use a field calledloadHazard with values “Yes” and “No”.
Step 2: Create a Cell Decorator
Add a cell decorator function in thecellDecorators section of your risksheet.json configuration:
- Checks if
loadHazardfield is not “Yes” - Appends the column ID (
hazard) tosystemReadOnlyFieldsto mark it read-only - Applies the
creadonlyCSS class for visual indication
Step 3: Apply the Decorator to Your Column
Reference the decorator in your item link column definition using thecellRenderer property:
Step 4: Add Visual Styling (Optional)
Define CSS styling for thecreadonly class to visually indicate read-only cells:
Advanced Patterns
Multiple Conditions
You can combine multiple field checks:Conditional Visibility
To hide cells completely instead of making them read-only:Common Pitfalls
Verification
After applying this configuration:- Reload your RISKSHEET to apply the new decorator
- Open a Risk item where the control field is set to “No”
- Click the link column cell — it should appear grayed out and not editable
- Change the control field to “Yes” and save
- Refresh the view — the link column should now be editable
See Also
- Configure Dropdown Categories — Filter available link options using query factories
- Cell Decorators — Complete cell decorator reference
- Enable Editing of Upstream Columns — Make upstream sub-columns editable
- Configure Column Visibility — Show/hide columns dynamically
- Apply Conditional Formatting — Apply conditional styling to cells
Sources
Sources
KB Articles
- Dropdown categories for Risksheet
- Enable linking upstream items to the Risk based on a specific condition
- Collect multiple link columns into one column
- Display Sub-columns for multiItemLink columns
- Enable editing of read-only up-stream columns
RiskSheetContextMenu.tsSheetConstants.tsGridUndoStack.tsPolarionAppConfigManager.javaMultiItemLinkEditor.ts