Do you know any real use case for condition type "Never"? Do you know what is the difference between NOT SELECTING ANY read only condition and selecting option "Always"? If your answer is "No" to either of these questions, then you may find this blog post useful.
Read Only Condition:
You can specify read-only condition at Page Level, Region Level or at Item Level. Read Only condition specified at page level applies to entire page. When the condition is met, all the items rendered on the page (including items from global page) will be displayed as read-only. Similarly, Read Only condition specified at region level applies to all items defined under that page.
Advantages of using "Read Only" condition:
"Read Only" condition "Never":
What if you want one page item (or set of page items) to be always displayed as editable, irrespective of read only condition it inherits from region/page level? for e.g. may be a "Search" input item or "Comments" item? In this case, all you need to so is, set "Read Only" condition of this item as "Never". When we specify "Read Only" condition as "Never" APEX will NEVER renders the page item as read only.
"Read Only" condition "Always":
As you can easily guess, when we set Read Only condition as "Always" for any item, it will be rendered as read-only irrespective of read only condition it inherits from region/page level. This is useful for data which should not be editable, in any condition, by any user, from the given APEX Page. We could also consider using "Display Only" item type in these cases as an alternative to "always" read-only item.
One main difference between "Display Only" item and item defined with "always" read-only is, "Display only" item has control to specify whether you want to include page item value on page submit or not where as Read-Only item values are always submitted.
Here is the link to demo page where you can observe above points discussed.
APEX Versions: 18.1,18.2 and 19.1
Thank you.
Read Only Condition:
You can specify read-only condition at Page Level, Region Level or at Item Level. Read Only condition specified at page level applies to entire page. When the condition is met, all the items rendered on the page (including items from global page) will be displayed as read-only. Similarly, Read Only condition specified at region level applies to all items defined under that page.
Advantages of using "Read Only" condition:
- Rendering: APEX automatically takes care how to display items in read only mode and what data to display. For e.g. for LOV based items, APEX will automatically display "Display" value.
- Security: When Item is read only, users should not be able to modify item value in any way. If we try to modify item value using JS and tries to submit page, then we get below error
What if you want one page item (or set of page items) to be always displayed as editable, irrespective of read only condition it inherits from region/page level? for e.g. may be a "Search" input item or "Comments" item? In this case, all you need to so is, set "Read Only" condition of this item as "Never". When we specify "Read Only" condition as "Never" APEX will NEVER renders the page item as read only.
"Read Only" condition "Always":
As you can easily guess, when we set Read Only condition as "Always" for any item, it will be rendered as read-only irrespective of read only condition it inherits from region/page level. This is useful for data which should not be editable, in any condition, by any user, from the given APEX Page. We could also consider using "Display Only" item type in these cases as an alternative to "always" read-only item.
One main difference between "Display Only" item and item defined with "always" read-only is, "Display only" item has control to specify whether you want to include page item value on page submit or not where as Read-Only item values are always submitted.
Here is the link to demo page where you can observe above points discussed.
APEX Versions: 18.1,18.2 and 19.1
Thank you.
Comments
and about what you mentioned:
The difference between the"Display Only" item and the item defined with "always" read-only is whether you could control the page item values included in submitting page, did you mean by the "Query Only" property or some other properties?
No, "Query Only" property is specific to items that are part of "Form" region only. This property, you can see under "Source" section. For display-only items, under "Settings" section, we can see "Send On Page Submit" property. I am talking about this property in the above post. Please read help text available in page designer for differences between these two properties.
Regards,
Srihari