This discussion is archived
5 Replies Latest reply: Sep 3, 2013 1:29 AM by BillyVerreynne RSS

apex.submit - the request value

BillyVerreynne Oracle ACE
Currently Being Moderated

Using a number of different Apex versions - on this particular server it is Apex v4.0.2

 

The documentation for JavaScript APIs indicates apex.submit() as setting the REQUEST variable - which I assume is the standard request item value used in Apex.

 

I have debugged the submission on the browser side and apex.submit() does POST the request value (as variable p_request). But the value is not accepted or set on the server side. Using :REQUEST or v('REQUEST) in the page's regions does not show the posted request value. It is null. There is no explicit branch condition on the page.

 

What do work is that the page items assigned values are submitted and seen by the back-end. E.g. if P1_NAME is set in apex.submit(), that value is seen via page regions/processes after submission. Unlike the request value.

 

Am I doing something wrong? Is this an issue with an older Apex version?

  • 1. Re: apex.submit - the request value
    jariola Guru
    Currently Being Moderated

    Hi,

     

    I think that is how APEX works.

    This might help

    Oracle Apex Tips: Accessing the last request value from a page submission

     

    Regards,
    Jari

  • 2. Re: apex.submit - the request value
    AndyH Journeyer
    Currently Being Moderated

    The REQUEST variable is populated when the page is submitted - REQUEST has no value until the page is submitted.

     

    The regions are created when the page is rendered. They, therefore, can only see a null value for the REQUEST.

     

    Rest assured that REQUEST is working as designed - otherwise no APEX interaction would take place!

     

    What problem are you trying to address?

  • 3. Re: apex.submit - the request value
    BillyVerreynne Oracle ACE
    Currently Being Moderated

    Correct. Which means post processing processes of the next page will be able to read the request variable. And yes, apex.submit() is used everywhere else and working fine.

     

    The issue is around a custom build JQuery confirmation region (instead of the default alert box). The region renders when javascript code is called - one of the parameters is a request object (as per apex.submit() format). So instead of calling apex.submit() directly (with the request), the intermediate javascript is called, it renders the JQuery widget, and when OK is clicked, it calls apex.submit() with the applicable request object passed by the caller.

     

    This works fine. All  Apex page items that are assigned values, are submitted with those values and the processes/regions/etc of the following page have the correct values. Except for the Apex request variable. If I define a Pn_REQUEST item on that page and set that instead via the apex.submit() call, the target page can successfully use this item instead, e.g. v('Pn_REQUEST'), as oppose to v('REQUEST').

     

    So the weirdness is that in this case apex.submit() sets the items to the specified values - but it does not seem to set the request state variable in PL/SQL.

     

    From the HTTP POST I can see the name-value p_request is set to the request value. But the target page rendered next, can use the item name-variables set (correct values), but not the request variable (is null).

     

    Oh well - for the time being I worked around it by not using request and using an additional item on the target page for setting processing state, and setting that via apex.submit(). Not sure what I'm doing wrong...

  • 4. Re: apex.submit - the request value
    fac586 Guru
    Currently Being Moderated

    BillyVerreynne wrote:

    This works fine. All  Apex page items that are assigned values, are submitted with those values and the processes/regions/etc of the following page have the correct values.

    The REQUEST value is cleared before page show processing unless it is set in a branch or URL, therefore it has no value when referenced in the following page.

    Set the Request attribute in a post-submit branch to the target page to &REQUEST. to make the current request value available during page show processing.

  • 5. Re: apex.submit - the request value
    BillyVerreynne Oracle ACE
    Currently Being Moderated

    Makes sense. Thanks. Will try it.

     

    Update: works exactly the way I wanted. Thanks again.

Legend

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