NEWBIE: Submit Page to set session state

I have a form that displays various items to include Popup LOVs (dynamic; based on session variables). If the user displays a page, the session state is not yet set so the Popup LOVs don't function correctly (until the user presses the Apply Changes button to submit the page). Can I automatically submit the page or set session state for those items used in the LOVs on page load? Note that I'm not too familiar with the use of javascript. I'm using Application Express version 2.0

Yes, I discovered that! Thanks for responding, though. I basically run a process (PL/SQL) under page rendering section that looks like:
begin
htmldb_util.set_session_state('P10_MACHINE_TYPE','&P10_MACHINE_TYPE.');
end;
Thanks!

Similar Messages

  • 4.2 select list on mobile page not setting session state

    Hi,
    Like I've done dozens of times in the past, I created a Select list that submits on change, and I expected session state to be updated accordingly.
    I tried this on a mobile page but session state is not updated for the item.
    Has anyone else experienced this?
    Scott

    Hi Scott,
    is it possible that you are hitting bug# 14680379 - PAGE SUBMIT ACTIONS DO NOT WORK FOR LONGER MOBILE SELECT LISTS, WHEN DEFINED TO FIRE WHEN THE SELECT LIST VALUE CHANGES
    on our Known Issues List http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-42-known-issues-1863578.html ?
    Is your select list selection displayed as native control or as popup? Can you create a test case on apex.oracle.com?
    Thanks
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Can't Set Session State from the Login Page

    I have a dilema. On the standard login page I enter values in 2 fields namely, CAMPUS (Select List) and USERNAME (text field).
    After clicking on the login button I want to navigate to PAGE 1 and use the values of CAMPUS and USERNAME to filter data. I have created two APPLICATION Level items (A_USERNAME,A_CAMPUS) to which I assign the values of USERNAME and CAMPUS in two AFTER SUBMIT computations on the login page.
    When I arrive on PAGE 1 the session state values of A_USERNAME,A_CAMPUS are still both null therefore the query returns null. It seems that the login process does not issue a SUBMIT for session state to be saved. How do I save the values in session state on login?
    In the Login PROCESS, can I specify the Page 1 items to be set and the values to set them in a URL somewhere? Is it here?
    wwv_flow_custom_auth_std.login(
    P_UNAME => :P101_USERNAME,
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v('APP_SESSION'),
    P_FLOW_PAGE => :APP_ID||':1' <<========here?
    If so what is the correct syntax?
    If I revisit the login page a second time, a submit is issued and the values are set in session state.
    Anyone got any ideas??
    I tried creating a standard position button which issues a submit but this didn't work either.
    regards
    Paul J Platt

    Unfortunately your solution is causing problems with retrieving cookies that I try to get for the campus and username during a "Before Header Process" as well. The cookies are normally set on an "After Submit" process. When I return to the login page I get
    Error ERR-1029 Unable to store session info. session=10760914996048113736 item=8561939526127479
    ORA-02291: integrity constraint (FLOWS_010600.WWV_FLOW_DATA_FK) violated - parent key not found
    But if I turn the cookies off, it seems to work OK.
    regards
    Paul JP

  • Application Express - setting session state.

    I'm a relative newbie to APEX and am trying to set up and populate an application item into session state so that I can then have the value handy throughout the entire session and over all pages of the application. I've defined the item as FPC_Number in page Zero and have also set up a region in Page Zero where the FPC Number will be displayed across all pages of the application. It will not have a value until the user explicitly selects one from a drop down menu, so initially the value will be null. I'm having issues assigning the value. The value will not be assigned during the page rendering phase but at the page processing phase, correct? I have a computation set up as 'begin
    APEX_UTIL.SET_SESSION_STATE('F101_PROJECT_NUMBER',V('P14_PROJECT_NUMBER')); end; '. Does this look right? I get the error: PLS-00103 when I try to execute this. Any ideas?
    Update: I have deleted the calculation and am using a process only. I no longer get the PLS-00103 error message but still no value is displayed in Session_state.
    Edited by: V Rickert on Feb 26, 2013 7:38 AM

    V Rickert wrote:
    I'm a relative newbie to APEX and am trying to set up and populate an application item into session state so that I can then have the value handy throughout the entire session and over all pages of the application. I've defined the item as FPC_Number in page Zero and have also set up a region in Page Zero where the FPC Number will be displayed across all pages of the application. It will not have a value until the user explicitly selects one from a drop down menu, so initially the value will be null. I'm having issues assigning the value. The value will not be assigned during the page rendering phase but at the page processing phase, correct? I have a computation set up as 'begin
    APEX_UTIL.SET_SESSION_STATE('F101_PROJECT_NUMBER',V('P14_PROJECT_NUMBER')); end; '. Does this look right? I get the error: PLS-00103 when I try to execute this. Any ideas?
    Update: I have deleted the calculation and am using a process only. I no longer get the PLS-00103 error message but still no value is displayed in Session_state.APEX version?
    What type of item is "FPC_Number in page Zero"?
    Where is this process and when does it run?
    You said "I've defined the item as FPC_Number in page Zero", but the process is setting the value of F101_PROJECT_NUMBER&mdash;which looks like an application item&mdash;rather than "FPC_Number in page Zero".

  • Setting session state post-authentication

    Hi all,
    This application uses DATABASE ACCOUNT authentication, and has a post-authentication process that sets a few application items using code such as
    apex_util.set_session_state('F_MY_ITEM', v_my_value);These items are used to secure certain tab options within the application.
    The post-authentication PL/SQL works fine, I can't see anything wrong the the logic. I've debugged it and I know the values are being set. I'm checking the value of session state straight after using v('F_MY_ITEM'), along with checking my session ID matches up - everything seems ok there.
    The issue is that when I log in, the session state is not set for those items - even though the post-auth process is called with no errors raised. Apex debug states
    ... Session State: Save "MY_ITEM" - saving same value "Y"If I log out, then log in (without closing browser tab), the values are now set as expected (visual confirmation using conditionally displayed tabs, and of course checking session state from developer toolbar)
    Notably, Debug states something slightly different
    ... Session State: Save item "MY_ITEM" newValue="Y" escape_on_input="Y"There are a few other differences with the debug output, this this seems the most pertinent.
    The only difference I've been able to track down is if I'm logged into the application builder in the same browser.
    If I attempt to log in with a freshly opened browser, navigate directly to application URL, the behaviour works as expected. Tabs appear as if items are set.
    Could the fact I'm authenticated in the application builder be messing with session state behaviour?
    This is with Apex 4.0.2.00.07; agnostic to browser (IE/FF/Chrome); 11gr2
    Cheers,
    Scott

    I did consider this because I experienced the same thing with page processes.
    However, in this case my post-auth function is within a package and I don't use bind variables.
    I was essentially doing this in my package:
    apex_util.set_session_state('F_MY_ITEM', 'Y');
    my_log_proc(v('F_MY_ITEM'));And seeing Y in the debug log, yet once on my home page, viewing session state I see F_MY_ITEM as empty - unless in the scenario I described.
    It's not a showstopper since the users won't be logged in to the application builder, but it would be nice to know the cause.

  • Set Session State with Shuttle items

    Is it possible to have session state set with each item selected in a shuttle? You have a shuttle with 4 possible options, you select item 2 from the left portion of shuttle and it is moved to the right.. Can you set the session state at that point?
    What I am trying to do is take the session state after change in the control and use it to populate a text field below. The returned values are used in a sql select to populate the text box with a looked up value...
    Thank you,
    Tony Miller
    Ruckersville, VA

    TexasApexDeveloper wrote:
    Won't this just push the last items value in, as apposed to appending the value?
    Tony,
    No. Because for shuttle items the return value is stored as colon delimited string.
    Means after each change you will have a colon delimited string in the session state with selected values(moved to right).
    See this http://apex.oracle.com/pls/apex/f?p=46417:47

  • Javascript setting value in session state

    I have a javascript that figures our the interest rate for a mortgage loan based on principal balance, term and monthly payment. The script also rounds up to the nearest 8th. Here is the line code that sets the value on the APEX form:
    document.getElementById('P2_NOTE_RATE_TO_PITIA_31').value = cRate.toFixed(3);
    Obviously this line code doesn't set session state for the value. Users have to submit the form again to pass this new rate to other calculations on the forms.
    Is there another piece of code I need to add to force value to session state? The javascript is called via the page load and it will produce the correct rate when ever values are changed to warrant a new interest rate to be calculated.
    Here is the entire javascript:
    function loanrate() { 
    function getVal(item){
    if($x(item).value != "")
    return parseFloat($x(item).value);
    else
    return 0 ;
    //Allow rates of 0 to 100%, solve to the nearest 0.001%
    var a=0.00001;
    var b=1;
    var tol=0.00001;
    var test;
    var t;
    var y1;
    var y2;
    var P = getVal('P2_NEW_BAL_CALC');
    var A = getVal('P2_NEW_PI_TARGET');
    var N = getVal('P2_REMAINING_TERM');
    var nRate;
    var cRate;
    var root;
    var TEMP = a;
    // Allow only 100 iterations (more than enough for convergence)
    for(var k = 1; k<=100; k++) {
    // A*(Math.pow((1+i),N)-1)/(i*Math.pow((1+i),N)) = present worth of N payments of A (beginning
    // 1 period from now)
    // Finally, subtract P (the present worth, or the price).
    i = a;
    y1 = A *(Math.pow((1+i),N)-1)/(i*Math.pow((1+i),N))- P;
    i = b;
    y2 = A *(Math.pow((1+i),N)-1)/(i*Math.pow((1+i),N))- P;
    test = y1*y2;
    // If test>0, the function that is to be driven to zero has the same sign
    // for both sides of the interval.
    if (test>0) {
    b = a;
    a = TEMP;
    a = (a+b)/2;
    } else {
    // If test <0, the root of the equation is between a and b.
    // If the interval is small enough, return (a+b)/2 as the root.
    // If not, bisect the interval: save a as TEMP, move a (new) halfway toward b.
    t = (b-a)/2;
    if (t<tol) {
    root = (a+b)/2;
    // Compute the annual compounded rate, if payments are monthly
    //var annual = 100*(Math.pow((1+root),12)-1);
    root = root * 100;
    nRate = Math.round(1000 * root)/1000 ;
    cRate = (Math.ceil((nRate * 12)/.125)*.125);
    document.getElementById('P2_NOTE_RATE_TO_PITIA_31').value = cRate.toFixed(3);
    //$x_Value('P4_ANNUAL_RATE',Math.round(1000*annual)/1000);
    break;
    } else {
    TEMP = a;
    a = (a+b)/2;
    }

    I believe the following will do what you need.
    document.getElementById('P2_NOTE_RATE_TO_PITIA_31').value = cRate.toFixed(3);
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',0);
    get.add('P2_NOTE_RATE_TO_PITIA_31',$x('P2_NOTE_RATE_TO_PITIA_31').value)
    gReturn = get.get();
    ...

  • Application Items/Session State Values and Page Branching

    I have users coming into a specific page in my application, passing in a value on the url that sets the value of an application item, where a validation routine occurs. If their session validates, I want to send them to one page, if it does not, I want to send them to a login error page.
    During validation, I am setting the values of several application items so that these values can be saved and used throughout their session. The values appear to be setting correctly. I am concerned that setting the application items may not be limiting these values to a particular session. So, I have also tried setting the setting session state variables with code like:
    apex_util.set_session_state ('F203_REQ', vReqID);
    I found it curious though when I ran this page, not trying to branch so I could check session state, these values showed up as being application items and I saw nothing under session variables.
    The problem I am having is that once validated I don't know how to branch to these other pages. I have tried adding some javascript in the header to force a page submit so that I could use a branch setup on the page. However, when it comes time to evaluate the branches (it's using one of the application item values I set earlier), I'm getting an error that no branch has been provided. Further research suggests the application item values are being cleared on the page submit.
    So, (1) I either need to know how to preserve those values on submit so the page branch works or (2) I need to branch to the new page without using a page submit and instead doing that in a some code (assuming submit is clearing application item values). I have not been able to find an example of how to do this in code. If there is a way to do this in code, will the application item or session state variable values be retained? I will need these values to be available to the user throughout their session.
    Thanks for the help,
    Steve

    Steve,
    I am concerned that setting the application items may not be limiting these values to a particular session.They are set in the current session only.
    It is hard to know what you are doing exactly without seeing it. If you set up an example on apex.oracle.com we could could address one specific question at at time.
    Scott

  • Session state protection disables running of pages without argument

    Hi all,
    Shared Components=>Security=>Authentication Schemes=>Application Express - Current
    I did the folowwing steps :
    Shared Components=>Security=>Session State Protection=> Set Protection button
    in the folowwing screen press Enable followed by next
    in the next screen Press the Enable Session State Protections
    in the page Shared Components>Session State Protection>Session State Protection by Page
    both page 0 and 1 are unrestricted
    stil I can't run my app
    page 1 error :
    No checksum was provided to show processing for a page that requires a checksum when one or
    more request, clear cache, or argument values are passed as parameters.
    page 0 and 1 have no items
    page 1 has one region of type list
    and uses the list found on page 0 but uses a list template override od Pull Down Menu with
    Image the same list on page 0 has a list template of DHTML Menu with Sublist
    I am at a loss the nly solutions is to put session state protection off all together
    please help
    Kr
    Martin

    No problems if you run the app directly likes so :
    http://apex.oracle.com/pls/otn/f?p=29691:1
    when you login through apex.oracle.com
    WS : martijnke
    login guest
    passw : apex_demo
    then the error occurs
    it seems that from the buikder I can't run any page that does not have any parameters
    even if I make those pages unrestricted
    Martin

  • Session State

    I have a question more about best practices than implementation. I am hoping one of you more senior apex guys has an answer.
    - I have 3 pages (page1,page2,page3).
    - I have a breadcrumb on each for navigation
    - I pass a value, via url from page1 -> page2. It is displayed as a text field (save state) called itemOne on page 2
    - I click report column link that takes me to page3
    - When i follow the breadcrumb back from page3 -> page2 itemOne value was not persisted in the state.
    - I understand that is because when I was on page2 originally I did not do a page submit to get it in the state.
    ** My question: What is the best practice to get itemOne on page2 into state b/c the user is clicking a link and no page submit "needs" to happen?
    Thanks
    Jon

    Hi Jon,
    with the URL call you are persisting the value into the page item. It doesn't require a submit to persist into session state.
    -) Is it possible that the "Source Used" property of the page item is set to "Always, replacing any existing value in session state" or
    -) that the breadcrumb clears the session state for that page?
    Patrick
    My APEX Blog: http://www.inside-oracle-apex.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://apexplugin.sourceforge.net/ New!

  • Set session

    i have a peculiar problem.....when my application loads the search page appears. When i press get record....it shows no data or only one record when there are two records. This is due to the fact that the session is not being set as i am using radiogrps with submit. I have written the javascript and in the form elements i have given the command onBlur......but the session is only set if i click on dat particular item and not when the page loads.....pls help me......

    Hello,
    Your situation is not clear to me.
    >> This is due to the fact that the session is not being set as i am using radiogrps with submit
    Are you sure you are using radiogroup with submit and not radiogroup with redirect? Every time the page is submitted, session state is set automatically by the system, so you should not have any problem with session state values.
    >> … i have given the command onBlur......but the session is only set if i click on dat particular item
    The onblur even is being fired only after the item it attached to is losing its focus. In order to lose focus, the item first need to gain it, hence the need to ‘click’ on the item.
    >> … and not when the page loads
    If you want to fire a JavaScript code when the page loads, you should use the onload event.
    If you need some more help, please give us some more specific details on your situation, including what you are trying to achieve, and the code you are using.
    Regards,
    Arie.

  • How can I have the loading of a page CLEAR ALL session variables?

    Hi,
    At the time of logging in it needs to reset all session state or at least my collection.
    I thought it would be a quick easy thing to clear session state????

    I found it:
    1.) Goto the page of desired Session State clearing.
    2.) Select the + after "Processes".
    3.) Select "Session State" category.
    4.) Select whatever you desire to do!
    Clear Cache For Applications (removes all session state for listed applications)
    Clear Cache For Current Application (removes all session state for current application)
    Clear Cache For Current Session (removes all state for current session)
    Clear Cache for Items (ITEM,ITEM,ITEM)
    Clear Cache for all Items on Pages (PageID,PageID,PageID)
    Reset Preferences (remove all preferences for current user)
    Set Preference to value of Item (PreferenceName:ITEM)
    Set Preference to value of Item if item is not null (PreferenceName:ITEM)

  • Item session state during rendering

    Hi,
    Application Express 4.1.0.00.32
    Page process (before heading) sets session state for several items (Text, Always replacing ..., Static Assignment...) but the values are not persistent.
    Debug shows:
    0.32451     0.00116     ...Session State: Saved Item "P1013_REC_PP" New Value="15"          
    0.32567     0.00104     ...Session State: Saved Item "P1013_TOT_AANT" New Value="1"
    0.32671     0.00111     ...Session State: Saved Item "P1013_CURR_SET" New Value="1"
    0.32783     0.00094     ...Session State: Saved Item "P1013_REC_PP" New Value=""
    0.32877     0.00087     ...Session State: Saved Item "P1013_TOT_AANT" New Value=""
    0.32963     0.00060     ...Session State: Saved Item "P1013_CURR_SET" New Value=""
    Where is the 'second round' (immediately following the actual setting in page process) on setting session state coming from?
    Thanks, Jos

    Resolved,
    Dropped the items and recreated some new ones (with different names) and now its OK.
    The original items were copied from each other and renamed. Maybe this is (still) a bug...
    Jos

  • Session State Protection - Arguments must have Checksum - Help Required

    Hi everyone,
    I am using apex 4.0 and have set:
    Session State Protection = True
    Page Access Protection = Arguments must have checksum
    Application Item Protection = Cecksum required - Session Level
    Page Data Entry Item Protection = Cecksum required - Session Level
    Page Display-Only Item Protection = Cecksum required - Session Level
    On pages which contain a Interactive report the calls to other pages to update and or delete a record passing the PK of the record work OK.
    I have set these as follows:
    In the Interactive report LInk Colomn --> Link Attribute = onclick="new top.Ext.apex.PopupWindow( { url: this.href, title: 'Edit Classification Details', width: 530, height: 500, listeners: {'success': gReport.search} } ).show(); return false;"
    Target = Page in this Application
    Page = 302Item = P302_IDCLASS
    Value = #IDCLASS#
    Page Checksum = - User Default -
    The problem is on the "Create new record" button which is located on the Interactive report page. I have defined the button as:
    Button Attributes = onclick="new top.Ext.apex.PopupWindow({ url:'f?p=&APP_ID.:302:&APP_SESSION.::NO:302::::', title: 'Create New Classification', width: 530, height: 500, listeners: {'success': gReport.search} }).show(); return false;"
    Action when button click = Redirect to Page in this Application
    Page = 302
    Clear Cache = 302
    When I click the button I get the following message:
    Session state protection violation: This may be caused by manual alteration of a URL containing a checksum or by using a link with an incorrect or missing checksum. If you are unsure what caused this error, please contact the application administrator for assistance.
    If I change the Button attributes to be:
    onclick="new top.Ext.apex.PopupWindow({ url:'f?p=&APP_ID.:302:&APP_SESSION.::NO:::::', title: 'Create New Classification', width: 530, height: 500, listeners: {'success': gReport.search} }).show(); return false;"
    It works OK, bu the page items are not clear.
    Could someone please explaing to me what am I doing wrong so I understand my mistake ?
    Thank you
    Daniel

    Here's an interesting situation. I have been having great results with the prepare_url function, until I needed to pass a column value from a report into a popup.
    Originally, in the Column Link --> URL in the Report Attributes I had this. This worked great when there was no session state protection enabled.
    javascript:popUp('f?p=&APP_ID.:17:&SESSION.::&DEBUG.:17:P17_EVENT_LOG_ID:#EVENT_LOG_ID#','450','375');When I enabled session state protection and changed the URL link to this
    javascript:popUp('&VW_EVENT_LOG.','450','375');and then created an application item and computation in order to pass a checksum along
    APEX_UTIL.PREPARE_URL (
      p_url => 'f?p=&APP_ID.:17:&SESSION.::&DEBUG.:17:P17_EVENT_LOG_ID:#EVENT_LOG_ID#',
      p_checksum_type => 3
    );the checksum seems to get passed fine, but the column value for the EVENT_LOG_ID is being concatenated to the end of the checksum instead of being passed as the value for P17_EVENT_LOG_ID. I also noticed that the clear cache page (17) looks like it is also being attached to the beginning of P17_.., but I'm not sure if that's to be expected or not.
    It took me a while to figure it out, but when I started looking at the error message closely, I could see that the checksum is identical except for the last two digits, which coincidentally are the same as the ID for this record.
    The checksum computed on the request, clear cache, argument names,
    and argument values (17P17_EVENT_LOG_ID [C6161B29B4C078F68DCF430133407754] ) did not match the checksum
    passed into the show procedure (C6161B29B4C078F68DCF43013340775490). Any thoughts on how to pass a column value with a checksum to a popup window?
    Thanks,
    Joe

  • Session state variables across multiple ApEx applications

    We have a suite of loosely integrate ApEx applications that all share a common authentication scheme. When you first log in we attempt to load a series of session state variables with temporary data to streamline various logging and authentication related activities for the life of the session.
    However, these session variables seem to disappear when you move from one application to another, so they are not truly tied to just the "session" which carries over across all applications, but the application from which the session state is set.
    What is the suggested way, keeping in mind that the data being held may have security related context, to preserve values during a session, but regardless of which ApEx application you are in.
    The method we are using to share the authentication is using a common "Cookie Name" from a common subscribed authentication scheme as suggested elsewhere on this site and seems to work very well outside of this specific issue.
    Thanks in advance,
    Barney

    Apologies for the delay getting back on this.
    My use of the word "disappear" was probably misleading. They were not visible from the second application. When setting "Session State" I was under the impression that it was setting it for the authenticated session, not for the specific application. (I am referring to the: apex_util.set/get_session_state).
    Your solution will work fine, as long as I know which application the user last authenticated against. However, it could be one of over 30 (and growing) different applications which would require me writing a program to go through every "p_flow" to try and find a valid value every time I need to reference the field.
    It would be really beneficial if you could store true Session variables which stay alive for the life of the authenticated session and is available to anything authenticated against that session id. This would streamline alot of cross-application program development.
    The "get/set_session_state" is a misleading as it is not a Session value, but an Application value. The Session exists across multiple applications, while this procedure does not.
    Thanks,
    Barney

Maybe you are looking for

  • How can i delete all my photos and music easily?

    how can i delete all my photos and music easily? I have changed to a new macbook and given the old one to my partner (generous?) and want to delete a lot of my stuff on the old one (iphoto and itunes) without losing safari and mail data, settings etc

  • IPod touch 5th Gen keeps freezing

    Yesterday I was using my iPod and it suddenly wouldn't turn on.  My Home button has been broken for at least 6 months, so I use the Sleep/Power button to turn the screen off and on.  Suddenly it wasn't responding.  Luckily, the iPod was almost dead s

  • Trigger Mail on Assigned JOB in Workflow

    Hi, I have to send mail to specified JOB (option in drop down of Recipient Type) in Workflow, but its not working though WF is not showing any error (showing success)  but user is not getting mail. I have changed it to Hard-Code user Name then user i

  • Lr3 to cs3 dont match

    when i edit in lr3  then transfer photo to cs3  the photo shows up in cs3 wih a different color cast and grainy. ihave a mac v10.6.8.

  • Post processing errors in REM

    Hi Gurus, What is significance of post processing in REM? We have 4 options. 1)     MF45 u2013 Post process Individual 2)     MF46 u2013 Post process Collective 3)     MF47 u2013 Post processing list 4)     COGI u2013 Post processing individual Compo