There are a few ways to populate display only values and save them. One simple and effective way is to populate them from a select list. The Skill Builders Super LOV is very effective for that, since it lets you map items from a list of values to one or more page items.
You can get the plugin here: - Item Plugin - SkillBuilders Super LOV
The plugin is well documented, so installling it shouln't be a problem.
In short, there are various ways to set a display only item, perhaps you can explain what it is that you want to do, ie what kind of item do you want to set and how do you plan to determine what the value of the item should be. Also can you tell what version of APEX you use?
I got a Display Only text field that is set by a Dinamic Action with the &APP_USER. after another field is set by the user.
The problem is that when this Display Only item with Dinamic Action, everything occurs ok, but when I try to apply changes, I receive a error message: "Session state protection violation: This may be caused by manual alteration of protected page item P9_INICIO_PRE_USUARIO. If you are unsure what caused this error, please contact the application administrator for assistance"
If I set "Save Session State" to NO the error doesn't happens, but the data isn't saved.
Apex version. 4.2.3.00.08
Okay that's a common problem. The display-only attribute doesn't let you save the item, What you can do is render the item as a normal text field and then put the following in your region header:
This will make a read-only field of your page item. Read only is not enterable by the user, but is submitted to the database. The .css part at the end is to give the textfield some shading, to let users now the field is not enterable.
Note however that this is not a secure practice: you can easily alter the field value from your browsers console, for example. To ensure you store correct data in your database you still should use some pl/sql validation or process.