Eslam
Eslam

Reputation: 363

Display Only vs text fields with "Disabled" attribute set to YES

I am using APEX 21.2.

The help says that "Display Only" Items do not store session state value and text fields with "Disabled" attribute set to yes do. But I tried to create an after header computation and set the value of a display only item and it worked. Is it wrong information or am I missing something?

Disabled
Specify whether this item is disabled, which prevents end users from changing the value.

A disabled text item still displays with the same HTML formatting, unlike an item type of Display Only, which removes the HTML formatting. Disabled text items are part of page source, which enables their session state to be evaluated. Conversely, display only items are not stored in session state.

Upvotes: 1

Views: 1606

Answers (2)

Koen Lostrie
Koen Lostrie

Reputation: 18630

A computation before rendering is always possible, that has nothing to do with session state. This is about how the item behaves on page submit.

With the "Display Only" item type you can control its behaviour on submit. Behaviour is the same for "Text Field" items that have the "Disabled" property set to on.

enter image description here

I did a quick test with a form on the EMP sample data set. Create a after header computation of type expression :P1_SAL + 1.

Test 1: Setting "set on page submit" on. The form renders with the salary item increased by 1. When page is saved, the new salary is saved for the record

Test 2: Setting "set on page submit" off. The form renders with the salary item increased by 1. When page is saved, the new salary is NOT saved for the record

Where did you see this help text ? I don't see anything about session state.

Upvotes: 1

Littlefoot
Littlefoot

Reputation: 142705

I tried to create an after header computation and set the value of a display only item and it worked

Why wouldn't it work? It is you (a developer) who set it using a computation (which works), but end user can't modify its value as it is set to be display only so - users can just look at item's value.

Upvotes: 2

Related Questions