How do I clear application level item of the last value it held?

See next post - I oopsed the first try.
Edited by: user3034406 on Jul 28, 2009 1:48 PM

Using oracle 11g, apex version 3.0.
Ok, so I am developing a survey with questions and their related answers (either radio group or checkbox depending). I have it set up so that when a user clicks a checkbox, an apex_collection is updated. In the pl/sql of my region source, I left outer join to this collection to display the checkbox as checked when its value is found in the collection. Using this same strategy, I can delete a value from the collection when a user uncheckes a box....
The problem I am having is this: the very last value that a user checks initially (i.e. takes checkbox from unchecked to checked status) is staying in my application level item :ADD_THIS, so when the page is refreshed or whatever, this value gets added to my collection, which means it shows as checked. Well, I think this is what is happenig...!
I have tried setting the app level item to null in a computation process, but this screwed everything up and nothing would work right....
So, if someone knows when, how and where to reset an app level item?
NOTE: I barely know javascript (getting the hang of simple stuff but I have a long way to go!) and am a little shaky on things like session state, before load, after load, etc., etc, when it comes to apex. Please be patient with me! (smile)
Here's what's going on script wise:
PL/SQL in region source of page: builds list of questions and their associated answers
DECLARE
#####stuff here####
CURSOR multiple_answer_cur IS select apex_item.checkbox(1, nvl(a.c001, a.answer_seq),'onclick="f_updateMember(q_seq, a_seq);"', a.c001, null, v_q_seq) cbox, a.answer_text, qa.question_seq, a.answer_seq
*<etc. etc....>*
CURSOR single_answer_cur IS select apex_item.radiogroup(radio_global, nvl(a.c001, a.answer_seq),a.c001, null, null, null, 'f_updateMember(q_seq, a_seq)',null, v_q_seq) rgroup, a.answer_text, qa.question_seq, a.answer_seq
*<etc. etc....>*
BEGIN
####stuff here that builds survey and writes it using HTP. to page####
END;
Javascript function to add or delete from collection (in header of page)
function f_updateMember(q_seq, a_seq){
--determine if value represents checked or unchecked box
var isString = /q|a/;
var getThis = document.getElementById(q_seq).value;
var findinValue = getThis.search(isString);
var getaddthis = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=AddCheckboxValue',0);
var getdelthis = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=DelCheckboxValue',0);
--onclick, if an 'a' or 'q' is found in value, this box is in the collection and therefore checked, so delete it
if (findinValue != -1) {
getdelthis.add('DELETE_THIS', "q"+q_seq+"a"+ a_seq);
getdelthis.GetAsync(function(){return;});
getdelthis = null;
}else{
--onclick, no 'a' or 'q' is found in value, this box is not in the collection, so add it
getaddthis.add('ADD_THIS',"q"+q_seq+"a"+ a_seq);
getaddthis.GetAsync(function(){return;});
getaddthis = null;
Snippet of page source
<b>Question number one</b>
<input type="checkbox" name="f01" value="q78a489" checked="checked" onclick="f_updateMember(78,
489)" id="78" />Answer option one for question one>
<b>Question number two</b>
<input type="checkbox" name="f01" value="483" onclick="f_updateMember(77, 483)" id="77" />Answer
option one for question two>
Edited by: user3034406 on Jul 28, 2009 12:18 PM

Similar Messages

  • Setting application level item during authentication

    We’re having an issue with an application level item that we set during our custom authentication function to store a role list for authorization. The issue is that the application level item, which should be set using htmldb_util.set_session_state(‘ITEM_NAME’, p_item_value), is not being set.
    On further investigation we realised that this issue was only affecting developers, not users of the application. This seems to be because the home page link, set in Shared Components > Edit Security Attributes, is set to “f?p=&APP_ID.:1:&SESSION.”, which means that the developers session was being passed to the application when the “Run Application” button was pressed. What then happens is that following the successful execution of the authentication function, a new session id is generated and visible on the URL and the Application Level Items are not set correctly.
    Examples:
    I’m developing an application on Apex that has the home page link set to “f?p=&APP_ID.:1:&SESSION.”, here’s the first part of my URL at the Application home page:
    http://apex.oracle.com/pls/otn/f?p=4000:1:1065658352862710::
    I hit “Run Application” and get to this URL (note the session id is the same)
    http://apex.oracle.com/pls/otn/f?p=16033:1:1065658352862710:::::
    I log in using any old username and password (the auth scheme on this demo app always returns true) and I get to this URL (note the session id is different):
    http://apex.oracle.com/pls/otn/f?p=16033:1:1403999736046638
    My application level item is not set and I start to cry. When I recover from my tearful episode I try to log in again, I hit logout and get taken to this URL:
    http://apex.oracle.com/pls/otn/f?p=16033:1
    I log in again (with the same username or different, it doesn’t matter) and low and behold, my application level item is set ok. This is the URL I can see (note another new session id):
    http://apex.oracle.com/pls/otn/f?p=16033:1:4917752800353335
    In despair, I close my browser window and go to my other application, this one has got the home page link set to “f?p=&APP_ID.:1” (no session id passed).
    I log back into Apex as a developer and go to the application home page at this URL:
    http://apex.oracle.com/pls/otn/f?p=4000:1:131988631742187::
    I hit “Run Application” and get to this URL (note the session id is missing):
    http://apex.oracle.com/pls/otn/f?p=19114:1::::::
    I log in using any old username and password (same deal as before) and I get to this URL (new session id):
    http://apex.oracle.com/pls/otn/f?p=19114:1:4320851658879093:::::
    Amazingly, this time the application level items are set first time.
    What I’d like to know (there is a purpose to this) is:
    - Why is a different session allocated to the application after login, when a “developer’s” session id is passed to the application?
    - If I remove the session id from the home page url what is the impact? I can’t think of anywhere within the application that this is used (other than between page 101 and the home page), but our thoughts are that this could mean that users end up generating more sessions on the server.
    - Is there any other way around this, perhaps using a different method of setting the application level item? The authentication procedure which sets the item reads as follows and mimics our authentication procedure (which you can assume does a little bit more than just returning true):
    function test_login 
      (p_username in varchar2 default null, 
      p_password in varchar2 default null) return boolean is 
    begin 
      htmldb_util.set_session_state('F16929_SYSDATE', to_char(sysdate, 'DAY')); 
      return true; 
    end;- Has anyone else encountered difficulties with the setting of application level items during login or has anyone come up with a more ingenious plan for passing something back from authentication that can later be used for authorisation?
    Thanks
    matt

    Scott,
    Many thanks for the response.
    We've found a way around this now, by changing the developer's usernames to the same as their NT/ Active Directory signon, which fools APEX into maintaining the session id from their builder session even though when logging into the application they get authenticated by LDAP.
    Using a post authentication process would be ok but I can't see any way of passing a variable retrieved in the authentication process under the first session to the post authentication process so that it can be set in the second session. We'd either therefore have to insert the data into a table and read it back or add an extra LDAP call to retrieve the user role/ group list during the post authentication process.
    Thanks again,
    Matt

  • Can't access  Application level item

    Hi,
    I have set an Application level item. I have tried to assign it as a default value on a Page Item but nothing is being shown.
    Application Level Item: APP_USER_ID
    On New Instance computation:
    select user_id
    from isp_user
    where login_id=:APP_USER
    Page Item: P57_CREATED_BY
    Default Value: &APP_USER_ID.
    Default Type: Static Text with Session State Substitutions
    No value is displayed, but if I replace &APP_USER_ID. with &APP_USER a value is displayed.
    Thanks for any assistance.

    OK, I've simplified the scenario to avoid any confusion. I'll give you a step by step of what I think you are telling me and see how we go. Believe I feel like I've tried everything...sure it's just my inexperience with the tool.
    Via Shared Components/Items created....
    Application Level Item: APP_USER_ID
    On Page 57 of my Application I created a Before Header computation:
    Item Name: APP_USER_ID
    Type: SQL Query
    Computation Point: Before Header
    Computation: select 21 from dual
    I assigned this to be the default value for a database field on Page 57, defined as follows:
    Page Item: P57_CREATED_BY
    Display As: Text Field
    Source Used: Always,replacing any existing value in session state
    Source Type: Database Column
    Default Value: &APP_USER_ID.
    Default Value Type: Static Text with Session State Substitutions
    I logged out and logged back in. I checked Session State and saw that the APP_USER_ID Application Item exists but has not value.
    I navigated to Page 57... no value is displayed in the P57_CREATED_BY field... If I review the Session State I can see that APP_USER_ID Application Item has a value of 21.
    Changing &APP_USER_ID. to &APP_USER. displays a value which seems to indicate it is not an issue with the field definition.
    Hope that is a little clearer.
    Thanks, appreciate your help.
    Jona

  • Adding pl/sql expression to application level item

    I would like to have an item shared by all pages within my application. My understanding is that I can define an application-level item for this.
    I know that for page-level items I can pool a value from the database by putting a pl/sql function into the item's "source value or expression" field and by setting the source type to "pl/sql expression or function".
    But I cannot do that for an application-level item. In fact, when I create my application-level item, the properties screen of it has pretty much nothing available to configure. It only has Name, Security, Build Option and Comments.
    Please, advise on how I can pool a value from the database for an application-level item.
    thanks
    Boris

    Boris,
    Application-level items are items that do not get rendered in HTML. They are for keeping named values in session state only and are available for use throughout the application. However, all page items are available for use throughout the application.
    What do you mean by "I would like to have an item shared by all pages within my application. "? If you want an item that gets rendered on every page, create a page 0 and put regions/items on that page.
    I don't know what you mean by "pool a value from the database".
    Scott

  • How to define a application level (or page 0) plsql validation

    I have a selection region on page 0, which I use on a lot of pages. I want to define plsql validation for the items in that region.
    I have already a database package with the validation code.
    Now I want to define each validation only once and not on each page.
    How can I do this.

    Funny thing happened to me on the way to creating my scenario on the apex.oracle.com site. I actually got it to work there. Once I attempted to simplify my scenario to reproduce it on apex.oracle.com, I figured out a simple step (hack?) that I was missing. I put that back into my site and it's working there now as well.
    If it's useful for others who attempt to do something like this, I needed to create a page-level process which doesn't really do anything except have a "NOT NULL" condition of the APP_ERROR_MSG application-level item and then use the "&APP_ERROR_MSG." syntax in the "Success Message" of that process. In essence, I'm telling the process to display the error as a success message when the APP_ERROR_MSG item is not null.
    I feel this is a hack because I would prefer to have this error message processing at the application level rather than at the page level. I was forced to put this process at the page level rather than at the application level because (as of ApEx 2.2) application-level processes do not have a "Success Message" option, only an "Error Message" option, while page-level process have both.
    Maybe my "fix" is truly a hack and I would love to hear that in order to get a better solution, that is more generic and application-level based. My sample app is at http://apex.oracle.com/pls/otn/f?p=32483:1 with the username of "devguest" and the same as the password.
    I look forward to hearing some thoughts.

  • Set item value from application level item

    Hello,
    I'm using Apex 2.2.1.00.04. I've modified the Page "No Tabs" template so that I can have my own Form (which is submitted to an outside website). On this form, I create some hidden items:
    <form name="frmEPay" method="POST" action="some_website">
    <input type="hidden" id="i1" name="userId" value=&G_ID. />
    <input type="hidden" id="i11" name="timestamp" value="" />
    <input type="hidden" id="i12" name="hash" value="" />
    On this apex page, I have a javascript function which is called in the onload (basically, the ApEx webpage displays and then is redirected). Here's a snippet of that function:
    var appProc = new htmldb_Get(null, html_GetElement('pFlowId').value,'APPLICATION_PROCESS=PrepEPay',0);
    appProc.get();
    appProc = null;
    document.getElementById('i11').value = "&G_ECOM_TIMESTAMP.";
    document.getElementById('i12').value = "&G_HASH.";
    document.frm_infiNET.submit();
    As you can see, the function calls an application level On Demand process (PrepEPay). That process sets the values of the application level items G_ECOM_TIMESTAMP and G_HASH. After those App level items have their values, I want to take those values and apply them to the hidden items on my custom form. Unfortunately, it doesn't work how I have things currently. I've verified that the On Demand process is running(by viewing the Session report on the page). So my problem seems to be this: 1. Retrieving the values from the Apex application level items
    2. Setting those values to the values of my hidden items (on my custom form)
    I think the biggest reason why I'm having difficulties is because I have to do a lot of this in the template, since that is the only way to have a separate Form. Maybe my problem is that I don't understand how to reference the Apex application level item value from a different form?
    Thanks,
    Marty

    Marty,
    You are describing this as if you expect the substitution within "&G_ECOM_TIMESTAMP." and the other one to take place in some kind of lexical order, e.g., from the top to the bottom of the HTML. The replacements happen in the engine, before anything is sent to the page. Then the browser interprets language constructs such as javascript calls which in your case includes an ajax invocation of a server-side application process.
    You need to re-think the machinery here.
    Scott

  • How to keep an application level object running with SunIDM?

    We are working on intergrate a gmail project with SunIDM. We need an application level object running with SunIDM so it will maintain a token generated from Gmail side. In anther servlet project, I had this object saved in the attribute of the ServletContext, then other session level servlet could share this attribute anytime. Is there a way to store attribute in Servlet Context and have it shared by different user session in SunIDM? I have been reading documents and searched this forum, haven't find any topics related how to maintain an application level object live. Hopefully that I can get some hint here.
    Thank you so much.

    Paul, Thank you so much for the further explaination. I don't think it will work since the token generated from gmail will expire every 24 hours.
    We are using the gdata library published from by gmail people, and I create a new UserService object and have it run in the application level. The UserService object will generate a token and renew it every 24 hours behind the scene. Here is how I implement it in my Servlet project:
    //to have a UserService object running at the application level:
    public class GmailUserService extends HttpServlet {
    public void init(ServletConfig config) throws ServletException{
    super.init();
    userService = new UserService(myApplication);
    config.getServletContext().setAttribute("gmailUserService", userService);
    //to access this UserService object from other servlet in each user session:
    UserService userService = (UserService)servletContext.getAttribute("gmailUserService");
    Gmail will trigger an error if we create a new UserService object for each user. They recommend to have all the user to share one UserService object. I am looking for similar approach in SunIDM.
    Thank you again, Paul, for trying to help.

  • Application level item

    I am creating a public site (no authentication/authorization). In my application, I created an application level item and would like its value to be based on a value from the database. Do I use an application process or application computation to populate its value ?
    Thanks in advance.
    Message was edited by:
    [email protected]

    I would probably use an Application Computation with a computation type of "SQL Query".

  • How do I clear list of items purchased without deleting the apps?

    How do I clear list of items purchased without deleting the apps? Also, is there away to attach photos from camera roll when replying or writing a new email?

    There is no way to remove items from the purchased list on the iPad.
    You can send a photo from the mail app by tapping and holding down in the body of the email and select - Insert Photo or Video - from the black options bar that will pop up.

  • Not cleared two line items from the GR/IR clearing

    For one of the items in PO following transactions are done...
            Mtype   Date            Quantity             Amount
    GR   101    06/14/09        1 02.001            887.85
    GR   102    06/14/09        102.001-            887.85
    GR   101    06/14/09        101.999             887.85
    GR   101    07/22/09        102.001             923.61
    IR-L            06/14/09        102.001            887.85
    IR-L            06/14/09        101.999            887.85
    FBL3N: out put
    Open items
    Doc Type  Date                           Amount
    WE           06/14/2009 86            887.85
    WE           07/22/2009 96            923.61-
    Cleared items:
    Doc Type  Date                           Amount                                                                     
    WE            06/14/2009  96              887.85-
    Z9             06/09/2009  86              887.85
    WE            06/14/2009  96              887.85-
    Z9             06/09/2009  86              887.85
    System has not cleared two line items from the GR/IR clearing for this line item in PO.
    What could be the reason these items are not cleared and now how these line
    items can be cleared?

    Hi,
    When the Dr and Cr amount are equal to zero system will automatically clear the line items in F.13.  Here the open items are appearing with different amounts due to that system not able to clear.
    By passing some manual JV or something you done to make Dr and Cr equal to zero then you clear through F-03(untick post automatically for this clearing in T.cdoe FS00)
    Regards,
    Sankar

  • I bought the iPad and got it home and when I turned it on, all I see is the iTunes logo w/ a usb connector and arrow. How do I clear that and go to the home screen??? HELP!

    i bought the iPad and got it home and when I turned it on, all I see is the iTunes logo w/ a usb connector and arrow. How do I clear that and go to the home screen??? HELP!

    You need to Set Up the iPad... Connect it to iTunes...
    See here for Getting Started...
    http://www.apple.com/support/ipad/
    and here...
    iPad User Guide iOS 5
    http://manuals.info.apple.com/en_US/ipad_user_guide.pdf

  • How can i create a new item in the app "health"?

    how can i create a new item in the app "health"? I need a field for documentation of "Waist-to-height ratio", exactly for "circumference".
    It's a matter of common knowledge, that the Waist-to-height ratio (WHtR) has more significance then the Body-Mass-Index (BMI).

    If you mean you want to change a color of a calendar category or create a new one, you cannot do that, what is pre-loaded is what you get and cannot be edited.

  • ICal keeps sending email notifications from all agenda items from the last 2 years. After laptop start up this action is repeated every hour. How can I stop these 300 emails coming in every hour?

    iCal keeps sending email notifications of all agenda items from the last 2 years (then I bought my laptop). After laptop start up this action is repeated every hour. How can I stop these >300 emails coming in every hour?

    Hi,
    We have rolled out a fix for this issue.
    Please log off and log back in to your machine and the issue should be resolved automatically. In case that does not work, please manually run the msi installer posted here (may require reboot).
    For details, please refer to the KB article here: Multiple RunOnce keys created 11.0.10 and 10.1.13 Acrobat | Reader
    Please let us know if you still face any issues.
    Thanks,
    Ashu Mittal

  • I accidentally deleted an Application on my iphone 5 and with it lost important files. How do i get back these files. The last iphone backup sync was after this so I cant even access an older back up as I cannot find them. How do I get back my Lost files.

    I accidentally deleted an Application on my iphone 5 and with it lost important files. How do i get back these files. The last iphone backup sync was after this so I cant even access an older back up as I cannot find them. How do I get back my Lost files.

    On your iMac launch iTunes and at the top next to the Apple symbol click iTunes > Preferences > Devices and tell me what you see. You last sync should be there showing only a device name. If you have an older backup it will be there as well the difference is it will be the device name with a date and time stamp. Sync and backups are two different things and there is a chance iTunes made a backup the first time you hooked up your iPhone 5. 

  • HT2905 Does anyone know how to find and remove duplicate items in the new itunes 11?

    I am having a hard time trying to figure out how to find and remove duplicate items under the New iTunes 11? Its not as user friendly as in previous versions. Does anyone know how to figure this out?

    As Jim said View > Show Duplicates
    or
    Option + View > Show Exact Duplicates

Maybe you are looking for

  • Illustrator CC won't open on Yosemite.

    Hello I recently purchased the CC suite on a student payment plan.  I primarily use Premiere, Photoshop and After Effects.  Today I tried opening Illustrator for the first time and I'll get it to open but once I click create or hover over any of the

  • After Updating to Flash Player 9 Links stopped working

    After I updated my flash plugin to 9 some of my flash links stopped working. Our site uses CMS to upload the flash files. I built them using actionscript 2. It's not all of the Swf that were affected just some of them, but they were all built the sam

  • Please tell me how to connect 3-wire-strang gage to NI 1314 (SCXI1520) by 1/4 bridges

    I'd like to connect 3 wire strain gage to NI-1314 (SCXI-1520) to measure the strain with quarter bridge configuration Please show me which line goes to which terminal..

  • Sync contacts and calendar without deleting....

    I want to sync my contacts and calendar in my iPhone with a macbook. The macbooks contactlist and calendar are empty. Hasn't been docked with it yet because a friend told me that all my contacts and apointments would be deleted since the iPhone is sl

  • How to install Russian language in ECC 6.0 ?

    Hi , Can anybody guide me how to install russian language in the system ECC 6.0 ? If you send the doc which has step to step explanation or screenshot that will really be benefit. Thanks Rajesh