jrcichra
jrcichra

Reputation: 345

Can't disable session state protection on Oracle APEX 18.1.0.00.45 for Dynamic Actions updating Page Items

I'm trying to update some page items with a dynamic action. I have an "on change" dynamic action on one text field and want to run a calculation on another column and display/save it.

I've tried disabling session state globally, but nothing I do seems to get rid of this error message on a page submit/process gets fired:

1 error has occurred Session state protection violation: This may be caused by manual alteration of protected page item P5_EXAMPLE_ITEM. If you are unsure what caused this error, please contact the application administrator for assistance.

How to I get rid of this error? I want to manually alter this protected page item...

Upvotes: 8

Views: 10209

Answers (4)

Dantel35
Dantel35

Reputation: 135

I had the following (similar) situation:

I have a page item :P1_A which is set to "Display Only". It has no other read-only modification done to it. It is not set to "Hidden", thus no "value protected" option is shown.

It still gives me the session state protection error.

I am pretty sure this is a bug, but that does not help you much when you are currently working on something and have to meet your deadlines.

If you are in the same situation, try the following workaround that works for me:

  1. Set the type to "Display Only".
  2. Set "Send on Page Submit" to "No".

This was enough for me already, since I wanted to show a result and not actually use the value.

If you really want to use the value, create another page item and set its source to "item" and "item" to the item you want to get the value of.

This is not the way this is supposed to work, I am sure. But it works for me.

Upvotes: 1

Bishan
Bishan

Reputation: 15710

Add this JavaScript code in page (P5) properties Executes when page load section

document.getElementById("P5_EXAMPLE_ITEM").readOnly = true;

Upvotes: 0

YotamW Constantini
YotamW Constantini

Reputation: 410

Alternatively, you can try removing the disabled attribute from the input item using a dynamic action after refresh of the region containing it:

$("#P5_EXAMPLE_ITEM:disabled").removeAttr("disabled");

Upvotes: 0

Littlefoot
Littlefoot

Reputation: 142743

From my own experience: it appears that P5_EXAMPLE_ITEM is a text item which has the "Read only" property set to "Always".

If that's so, set the item type to display only (because the first combination - a read-only text item - is nothing but a display only item with "save session state" set to "no").

Upvotes: 5

Related Questions