Forum Stats

  • 3,768,299 Users
  • 2,252,772 Discussions
  • 7,874,520 Comments

Discussions

Session state protection violation: This may be caused by manual alteration of protected page item

Baonerges
Baonerges Member Posts: 106 Blue Ribbon
edited Jun 23, 2020 4:08PM in APEX Discussions

Hi Everyone,

I am back with the age old question above. There are forum posts dating back to APEX 4 asking this. I want to keep the look of my radio groups and checkboxes while making them read only so hidden or display only will not achieve what I want. I got what I wanted by setting the read only property to always. This throws the error in the image below.

pastedImage_0.png

If I set Unwind Customer so it is not read only, it works. What is interesting is that the left side does not have this problem. I set all the items to read only on the left side and I can submit with no error. I am not manipulating any of these items. They are just there so that the left side and right side forms look the same. Initially users were supposed to be able to modify the entire right side but my end users changed their minds........ I'm sure they'll change their minds again so I am leaving everything as read only for now.

There is no debug message. Nothing comes on the console. I just get the error on screen. There is not javascript manipulating that data. Any help would be appreciated.

Tagged:

Answers

  • Eslam_Elbyaly
    Eslam_Elbyaly Member Posts: 4,229 Silver Trophy
    edited Jun 23, 2020 3:04PM

    Set page item > custom attributes to "readonly".

  • Baonerges
    Baonerges Member Posts: 106 Blue Ribbon
    edited Jun 23, 2020 3:16PM

    Did not seem to work. For P10_UNWIND_CUST_1, I set as follows

    pastedImage_0.png

    pastedImage_1.png

    When I submit I get the same error.

  • Eslam_Elbyaly
    Eslam_Elbyaly Member Posts: 4,229 Silver Trophy
    edited Jun 23, 2020 3:43PM

    You can set an item's value that was set to be read only.

    Just to get it straight, You need to prevent users from setting a checkbox/radio group on the client side, but you need to be able to set their session state, right?

    - Have you tried disabled="disabled"?

  • Baonerges
    Baonerges Member Posts: 106 Blue Ribbon
    edited Jun 23, 2020 3:53PM

    In the original image, I want the right side items to be read only like the left side items. I am not using any of those values or setting them. They are just for looks.

    The issue is when I set the radio groups and checkboxes on the right side to read only, I get the session state violation error, but I am not altering any of those items.

  • Baonerges
    Baonerges Member Posts: 106 Blue Ribbon
    edited Jun 23, 2020 3:57PM

    In the original image, I want the right side items to be read only like the left side items. I am not using any of those values or setting them. They are just for looks.

    The issue is when I set the radio groups and checkboxes on the right side to read only, I get the session state violation error, but I am not altering any of those items.

    - Have you tried disabled="disabled"?

    Does this option exist for radio groups and checkboxes? Do you mean I should copy paste that somewhere?

  • Eslam_Elbyaly
    Eslam_Elbyaly Member Posts: 4,229 Silver Trophy
    edited Jun 23, 2020 4:08PM

    Search for "P10_UNWIND_CUST_1" in the page designer to ensure you did not write any code at some point that sets it's value.

    - disabled="disabled" should be written into "custom attributes" attribute like you did with "readonly", but you won't need it if you're not setting the items' values. Read only = always is adequate unless we can not figure out the problem.

    - running page in debug mode will get you more information about the problem.