How to reliably determine if Section is in read-only mode
We have Sections embedded within other Sections and some of those have repeating lists. This is mostly done via Repeating Dynamic Layouts. Many of these Sections and lists are reusable and we have need to reuse them in both read-only and editable mode.
For embedded Sections set to read-only mode, all the input fields properly show up as read-only but we need to manually hide the action fields (buttons, links, etc). I see other posts that suggest to use the When rule pxIsEditable but that is woefully unreliable in my testing. That seems to only work for the first embedded Section but nothing beyond that.
My Section chain is as follows:
- Section A includes embedded Section B, set to always read-only.
- Section B includes embedded Section C, set to always read-only. Section C is dynamic and determined via a Property value.
- Section C displays input fields (text inputs, dropdowns, etc) and action fields (links and buttons). It also includes embedded repeating layouts.
Section C and beyond input fields all properly show up as read-only, except buttons and links which still show up as visible even when the Visibility is set to Condition (when rule) using pxIsEditable.
Duplicating most of our application to hard-code a read-only version of each Section just so we can hide buttons and links is not acceptable. Please help!
What can I do to reliably determine if the current Section is in read-only mode?