4 Replies Latest reply: Jan 26, 2013 12:58 PM by Tom Petrus RSS

    Super LOV - SSP error

    VANJ
      See https://apex.oracle.com/pls/apex/f?p=57688:4

      1. Using the fantastic Skillbuilders Super LOV plugin (latest version)
      2. Using the Map From/To feature of the plugin to set values from the selected row to a few Display Only page items
      3. The Display Only items have Save Session State = Yes because the values are used in page processing.

      Steps
      1. Click on the LOV popup icon
      2. Select any row from the popup
      3. The values from the selected row are set on the 3 page items
      4. Click on the Submit button

      This raises a SSP violation error, presumably because display-only items are manipulated and APEX jumps into action to prevent client-side hacking.

      How can this error be avoided? Tried the following
      1. Change the page item type to Text and set the Readonly property to Always.
      2. Change the page item type to Text and set Disabled = Yes

      No change in behaviour.

      Sigh, all these security related changes in version 4.x are getting really tiresome. I can understand the noble intentions behind them but they are making life so much more difficult, simple tasks get unnecessarily complicated :-(

      Help? Thanks
        • 1. Re: Super LOV - SSP error
          dmcghan
          VANJ,

          Change your display only items to hidden items (not protected). This will allow your page processing to work.

          Then create new display only items (do not save state). Then have Super LOV update both the display only and the hidden items.

          Regards,
          Dan

          blog: http://DanielMcghan.us/
          work: http://SkillBuilders.com/APEX/
          • 2. Re: Super LOV - SSP error
            VANJ
            Hm, didn't think of that, that should work. Thanks!
            • 3. Re: Super LOV - SSP error
              VANJ
              Dan - That takes care of the page processing but when the page refreshes, the display-only items remain blank because they don't save state. How can we have our cake and eat it too? I guess we can use the Source attribute of the display-only items to fetch the value or something like that but that would mean repeating the LOV query, not ideal for maintenance.

              When the LOV pops up, all the extra columns are useful to identify the row you need. In some cases, it helps to show those values on the page to provide some additional context but because of this new SSP lockdown in 4.x, the display-only items can't save state.

              Curious, when you designed this "return items into" feature, what use-cases did you have in mind?

              Thanks
              • 4. Re: Super LOV - SSP error
                Tom Petrus
                Hey VANJ,

                If you would like the superlov to perform the value fetching on page load then you could do that:

                Execute javascript on load:
                $('#P53_COMPROD_ID').apex_super_lov('setValuesByReturn', $('#P53_COMPROD_ID_HIDDENVALUE').val());
                Is what i usually do. Second parameter is the return item value.

                >
                The getValuesByReturn and setValuesByReturn methods can be used to programmatically fetch return values and set the item using the return values. getValuesByReturn will return a JSON object with the results from the fetch. setValuesByReturn goes a step further using the return values to set the display and return values for the item. Example(s):
                $('#P1_ITEM_NAME').apex_super_lov('getValuesByReturn', '101');
                $('#P1_ITEM_NAME').apex_super_lov('setValuesByReturn', '999');
                Now this isn't without some drawback and that would be that the values in the display items will only popup after the page has loaded and the values have been retrieved by the plugin. It will however save you from changing the item source to a sql query. See how it goes.