This discussion is archived
7 Replies Latest reply: May 24, 2013 8:50 AM by VANJ RSS

SSP violation error - Readonly items

VANJ Journeyer
Currently Being Moderated
https://apex.oracle.com/pls/apex/f?p=57688:22

APEX 4.2.2

I have inquired about a similar issue in the past but haven't really settled down on a good solution. The use case is there is a Display Only item (or Text item with Readonly condition Always, both of them look the same on the page) which is set using a Set Value DA using a couple of helper fields on the page. When the page is submitted, APEX raises a SSP violation error because it assumes malicious intent (readonly form item value changed between page render and submission).

How is this sort of thing best handled?

Thanks
  • 1. Re: SSP violation error - Readonly items
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    This protection was introduced with 4.1 and it doesn't allow modification of item set to read only (always, conditional). This is actualy a desired behaviour. It doesn't make sense to set an item read only if it needs to be modified and oposite. There are two solutions to your problem:

    1. do not use dynamic actions to modify read only items

    2. remove the read only condition and make the item to be a display only item

    Those are not getting saved regardless of the source and therefore no need to protect them.

    If the readonly state is only conditional, then make the dynamic actions also conditional.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------
  • 2. Re: SSP violation error - Readonly items
    VANJ Journeyer
    Currently Being Moderated
    It doesn't make sense to set an item read only if it needs to be modified and oposite
    Think of a long 20-digit string comprising sub-components. Each component string is familiar to the user so from a data-entry perspective it makes sense to split the field into pieces and ask the user to key in the pieces.

    Yes, the server side process can assemble the parts before inserting into the final database field but showing the "answer" on the screen is a nice touch. Hence the Set Value DA to show a sneak preview of the resultant field.

    Of course, I am over-simplifying. In my real use case, the final field is not a simple combination of its parts, there is a lot of logic in the DA to calculate it. Hence the final field cannot be a text/enterable field since users cannot calculate it on their own.
    2. remove the read only condition and make the item to be a display only item
    As stated, using a display-only item also raises the same error.
  • 3. Re: SSP violation error - Readonly items
    Denes Kubicek Oracle ACE Director
    Currently Being Moderated
    Are you sure that the display only item causes the same error? Just tested it here and I am not getting an error on display only:

    https://apex.oracle.com/pls/apex/f?p=31517:307

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------
  • 4. Re: SSP violation error - Readonly items
    ediazjorge Explorer
    Currently Being Moderated
    Hello,
    The use case is there is a Display Only item (or Text item with Readonly condition Always, both of them look the same on the page) which is set using a Set Value DA using a couple of helper fields on the page.
    I don’t see any problem when the item is declared as Display Only. See this example:

    http://apex.oracle.com/pls/apex/f?p=1550:3:0::NO

    I hope this helps you.

    Thank you,

    Erick

    Ignore this, Denes already said the same.

    Edited by: ediazjorge on May 23, 2013 4:43 PM
  • 5. Re: SSP violation error - Readonly items
    VANJ Journeyer
    Currently Being Moderated
    Sorry, I should have mentioned that the Display Only item has Save Session State=Yes I modified my example page to use that item and it throws the same error.

    The reason I need it to save session state is so that after-submit processing can read the value set by the DA instead of repeating the logic to compute the value.
  • 6. Re: SSP violation error - Readonly items
    ediazjorge Explorer
    Currently Being Moderated
    Hello VANJ,

    Probably you know this, but the DA Set Value lets you specify more than one item separated by comma.

    The way I would do it is to leave the Display Item with Save Session State = No, and create a Hidden Item (Value Protected = No) to save the value in session state, and finally include that item in the DA Set Value.

    Thank you,

    Erick
  • 7. Re: SSP violation error - Readonly items
    VANJ Journeyer
    Currently Being Moderated
    Yes, looks like that is the easiest way to solve this. Thanks.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points