Setting the value of an element of Application (defining a global variable);

Apex 3.2.0.00.27, I need to initialize a global variable to 0 to implement a variable to test to see if something on the page has changed. Will update to 1 when some lists of selection on the page are changed. Read through a few similar questions and answers within the forum, as well as blogs and other sites. So, I think that what I do is the way forward in this regard. Unfortunately, my point/global application initialization is not past yet. Here's an overview of what has been implemented:

1) has created an element of demand, G_CLASSIFICATION_ID_NEW in the shared components.
(2) created the Javascript (JS) function called by addLoadEvent area header html page so when the page is loaded, the application global/G_CLASSIFICATION_ID_NEW element should be set to 0 with the following JS and using AJAX and htmldb_GET:

< script type = "text/javascript" >
function initVars()
{
Alert ("before the initvars get");
get var = new htmldb_Get (null, $x('pFlowId').value, null, 22);
Get.Add ('G_CLASSIFICATION_ID_NEW', 0);
gReturn = get.get ();
{if (gReturn)}
Alert (gReturn.value);
}
get = null;
Alert ("after get initvars");
}

Alert ("before the call to the initpage");
addLoadEvent (initVars ());
< /script >

I used the htmldb_Get successfully to populate other global variables and processes on request with onchange THAT JS call in the attributes of html form elements select list on the page. Later, I check the globals via the Session view and research on elements of Application. Unfortunately, I'm missing something, because my G_CLASSIFICATION_ID_NEW never gets filled when I load the page. The Alerts popup every when the page is loaded, so I know that the script is running when the page loads. alert (gReturn.value) is not defined. And, of course, the G_CLASSIFICATION_ID_NEW to 0 does not place.

I tried the htmldb_Get with her call for a process of application and without (null value). What I read, you should not need to call an application process to have the get.add of the value of the global variable. Here again, this could be where I'm wrong. However, as I mentioned, it works for the other functions called from an onchange to fill a part of the application, but the page has already loaded when the onchange (s) executed. They can work because the page is already loaded when the onchange is called. My point here is that my other on application processes are NOT set or modify global variables at all. The globals are preparing with the get.add (< element app >, < value >) part of my other JS works within the HTML header area. So I'm inclined to believe that I don't need 'application_process = < some_odp >' set parameter, but if it is not true, please let me know. If so, what should be in the application process-that is to say, what would be the purpose of the get.add (< application item >, < value >) if I set the global variable in the application process on because it's the only thing I could think to do within an application process on for this?

If someone can point out what I'm not understand or, failing to do it here, that would be great. I am doing fine with APEX, but don't consider myself a guru with it immediately. I'm certainly not a JS/AJAX guru, and when things like that, go astray, I get bogged down because I'm not sure of the problem. So, I hope that you gurus who monitor this forum can get going in the right direction.

Thank you
Bob

Hello

Create page 0 (zero) to your application.
Then try this javascript in your HTML page header


BR, Jari

Tags: Database

Similar Questions

  • Set the value of each element with loop statement

    Hello

    I use a collection to dynamically change my interactive report.
    But I need to get the names of the columns in my query to display the right-hand column headers.
    So I created the elements for each of them: P13_C001,: P13_C002,: P13_C003, etc. to give their value to my columns on the report.

    And I tried one before process header:

    ------------------------------------------------------------------------------------------------
    DECLARE
    Vs_Id USER_TAB_COLUMNS. COLUMN_ID % TYPE;
    Vs_Name USER_TAB_COLUMNS. COLUMN_NAME % TYPE;

    BEGIN
    I'm in 1.50
    loop
    Column_name, Column_id SELECT
    IN Vs_Id, Vs_Name
    OF USER_TAB_COLUMNS
    WHERE TABLE_NAME = my_table
    AND COLUMN_ID = i;
    ': P13_C00' | I: = Vs_Name;
    end loop;

    END;
    ------------------------------------------------------------------------------------------------

    Unfortunately it does not work, I have a synthax error:

    The following error occurred:

    ORA-06550: line 12, column 11:
    PLS-00103: symbol ': P13_C00 ' met instead of one of the following symbols:

    * (begin case declare end exit for goto if loop mod null *)
    pragma raise return select update while with...

    Has anyone an idea?
    Thank you!
    Fanny
    DECLARE
      CURSOR c_headings
      IS
        SELECT column_id, column_name
          FROM USER_TAB_COLUMNS
         WHERE TABLE_NAME = My_Table
        ORDER BY column_id
      ;
      Vs_Id USER_TAB_COLUMNS.COLUMN_ID%TYPE;
      Vs_Name USER_TAB_COLUMNS.COLUMN_NAME%TYPE;
    BEGIN
      FOR r_headings IN c_headings
      LOOP
        APEX_UTIL.SET_SESSION_STATE('P13_COO'||r_headings.column_id, r_headings.column_name);
      END LOOP;
    END;
    
  • Set the value of items when the box is checked

    Hello

    My requirement is when a checkbox is clicked it should set the value of an element such as 111111 and clear the values of two objects in a page of the apex.
    I used the java script onClick event to set the items using document.getElementByID ('Item_Name') = ";
    One element that needs to be eliminated is a type of conditional.
    When the element condional, java script works very well. But if it is not present.
    code works, but it displays "error on page" for a few seconds.

    Is it possible to erase the element only when the element is present in the page.

    Thank you
    Ravi

    Hello

    Yes as for example

    if($x("ITEM_NAME")){
     $s("ITEM_NAME", "");
    }
    

    Kind regards
    Jari

  • How to set the value of a * APPLICATION * with apex.server.process?

    If I have a page named point P1_MY_PAGE_ITEM, I could put its value in the session by doing this:

    $s('P1_MY_PAGE_ITEM', 'I Like Pie!');
    
    apex.server.process(   'dummy'
                           , { pageItems: "#P1_MY_PAGE_ITEM" }
                           , { dataType: "text",
                             async: false,
                               complete: function( ajaxResponse )
                                     {
                                          var ignoredReturn = ajaxResponse.responseText;
                                     }
                             });

    Which works very well. If you check the session, the P1_MY_PAGE_ITEM will now have the value: I like pie!

    However, if I have an Application element (not a page element!) named MY_APP_ITEM, how could I do the same thing? How can I use apex.server.process to set the value of MY_APP_ITEM in the session? I wouldn't be able to use "pageItems" because MY_APP_ITEM is not a page element, it is a part of the application.

    What is the correct syntax to do this?

    Thank you

    -Joe

    Hey Joe,

    Returning to that thread you made a couple of months ago, the answer is here:

    Post adjustment Application items in the apex.server.process for a * process application *.

    Defining a point of application is as easy as providing the name of the application element to p_arg_names Bay and set a corresponding value in the p_arg_values table.

    For example, in an application with article SOME_ITEM of the application, I can put the value as follows:

    (function(){
    var arrNames = [], arrValues = [];
    arrNames.push("SOME_ITEM");
    arrValues.push('some value');
    apex.server.process(   'dummy'
                         , { p_arg_names: arrNames, p_arg_values: arrValues }
                         , { dataType: "text"
                           });
    })()
    

    Any required application process. Should the item be free that you set it from the browser.

  • How to set the value of the point of application using pl/sql in the application process

    Hi guys,.

    I want a global variable (application point) whose value will be set to start when a user logs on to the application. The value will be retrieved from the database by using a sql query. I don't exactly know the syntax to set the value of the point of application in the application process. Also, I want to know what type of enforcement process should I use to set the value of the point of application, when a user starts a session. The value of the point of application varies from one user to the user.

    Help, please.

    I use apex 4.2

    Kind regards

    Waqas

    You can use the application element as a link with his name. That is to say. your point of application is named G_MY_APPLICATION_ITEM, then you can / set of access using: G_MY_APPLICATION_ITEM.

    For example

    BEGIN

    -assign as a variable

    : G_MY_APPLICATION_ITEM: = 'LARRY ';

    --

    -use in a SQL statement

    SELECT WHATEVER_COLUMN

    IN: G_MY_APPLICATION_ITEM

    FROM MY_TABLE

    WHERE USERNAME =: APP_USER

    ;

    END;

    Peter

  • Set the value of the page elements using apex.submit

    Hey,.

    Does anyone have an idea how to set the value of several page elements using apex.submit?

    Here is my request, she works for this element of the page, but I want to first the value of the other elements of the page (i.e. P30_SHOW_REF) as well.

    select s.nr as NRR, 
    '<input type="button" value="clickme2" onclick="document.getElementById(''BUTTONS'').style.display = ''block'';apex.submit({request:''SET'',set:{''P30_KLT_NR'':'||s.nr||'});"/>' Button 
    from klant s
    

    Thanks in advance!

    Hi Julijan,

    Here is the example:

    apex.submit({
      request:"DELETE",
      set:{"P1_DEPTNO":10, "P1_EMPNO":5433});
    

    Concerning

    J

  • dynamic action sets the value of the element, but not save to DB on submit

    I'm working on a page where the value of several to show only the page elements are defined using a dynamic Action.  They are set when the user selects a value in a list of selection (and is based on the value of the selection list).  Dynamic action is triggered on a list selection change event and then runs the real action "set the value.  The selection list displays the names of sales representative.  The three fields dynamically filled are the org structure (that is, their chain management).

    For the action to set the value, I use a defined Type of SQL statement:

    Select VP, DIR, MGR

    of SALES_ORG where SSR =: P20_SSR

    In the affected elements, I have fixed Type of selection to the 'item (s)"and the value of the Item (s) for 'P20_GVP, P20_DIR, P20_MGR.

    Dynamic action works fine for the display of the page (that is, when I select a sales representative in the selection list dynamic action properly updated only display value fields three).  This page is a form in which the user submits information relating to the rep.  When the page is sent, all fields are filled in a new record of DB with the exception of three that were populated dynamically above.  These fields get the values NULL.

    When the dynamic action updates the values in the three fields is - it does not set the value of session?  Why these fields don't are not taken into account in the submit other ideas > process Page?

    I use 5 APEX with Chrome on Mac (Yosemite).

    Thanks for the note.  I didn't only display the items could not be used in this way.  I think I'll take a different approach with the design; given that the org structure is in another table that I can simply refer to that by rep when necessary rather than saving the information uploaded to the page of the form.  The reason why I have not fill the screen only the points of loading the page is because I don't know what the values should be until the user selects a sales representative in the selection list.

    I'll change the design to one of the following:

    1) change the display only items of standard text field.  NOTE: if I make the text read-only field that causes other problems when loading (I get the message "violation of protection Session state").

    OR

    2) do not include org structure in the download folder and just refer to table org Rep when necessary.

    Thank you!

    Steve

  • Set a value of an element of value in the column of a checkbox (not ROWID) in an interactive report APEX 4

    I have an interactive relationship with an APEX_APPLICATION. CHECKBOX (1,MYCOLUMN) I want users to check the box in the column of the report, and then click a button.  When they click this button I want the value of an element of the value of the MYCOLUMN for boxes ticked.  I will concatenate the values with commas. I'm fairly new to APEX and can't seem to define the value AS #MYCOLUMN # is the column alias.  This value would be set with PL/SQL. I now get "#MYCOLUMN # as my value so I don't ' have the correct syntax.

    Any help is greatly appreciated.  Thank you.

    Hello

    Put this in the header HTML of your page and you should be good to go.

    Remember to change to the name of the element you want to be defined by the function.

    Note that I used al colon as a separator (in le.get (.join(':'))). You can change that to a comma if you like that better.

  • The assignment of value to an element of Application via JS

    Hi guys,.

    I am trying to assign a value to an element of application using javascript. But I can't do that when I try to view with alarm the result is empty. You have an idea how can I assign a value to an element of the application using javascript?

    Another yew (action is "ASSIGN")
    {
    var moname = $(el).children("td[headers='SOURCE']").text ();
    $s ('F10_SELECTED_OBJ', moname);
    Alert ($v ('F10_SELECTED_OBJ'));
    }

    Thank you

    You cannot reference elements of apex in javascript application because they are not rendered in the HTML DOM.

    See what {message identifier: = 10343221}

  • Set the value of the element

    Nice day

    I have a form with a data block and two elements in the data block. The first element is a checkbox control, while the second is an id I have set up a trigger on the ID element (after CHANGE) which must set the checkbox item if the ID has a system ID valid. The problem I have is that I can't seem to be able to set the check box. I need advice.

    Data block = VARREQ
    Articles:
    USE_VAR_FLAG (valid values are "Y", "N")
    VAR_ID (valid values are a number)

    The code I've tried so far:

    Start
    : VARREQ. USE_VAR_FLAG: = 'Y ';
    end;

    This does not set the value of the checkbox.

    Hello

    Sometimes we need to test pls create a button insert your code after change of BUTTON-WHEN-PRESSED new trigger
    then display message of your box it will come back?

    happy u solved your problem it comes to choice of trigger is not a code problem :)

    I think you can also use WHEN-VALIDATE-RECORD release...

    Kind regards

    Amatu Allah

    Published by: Amatu Allah on May 15, 2012 15:03

  • How to set the value of something in a component of the main application?

    Hello

    Maybe I've worked on it too long, but I can't understand how to set the value of the text property of a text entry field in my main application component in a block of mx:Script. I have a component called Login in the components folder, and I need to set the text value of empNum. In my statement of mxml up there, I said these components such as xmlns = "components.*" so, logically, the property, I'm putting a c.Login.empNum.text. I can't understand the correct syntax to make this work, and I've tried everything I can think of. Does anyone have any suggestions? I think this should be easy, and there is just something missing me.

    Thank you!
    Holli

    Have you tried to give him an id?

    If later you can make the loginScreen. empNum.text = "my text".

    Laurent,

  • HOW TO SET THE VALUE TO A PAGE OF AJAX ON DEMMAND PROCESS ELEMENT?

    Hi, I have a javascript that calls an ajax on demmand process , and I need a the ajax process variable value is updated about my page: P2_CONTENT:

    • Here's my javascript call:

    doprint() function

    {

    Apex. Server.Process ("GENTICKET", {pageItems: "#P2_PARAM1"}, {async: false});

    }

    • and here is My ajax on demmand process (GENTICKET):

    BEGIN

    declare

    CONT varchar2 (1000); -the return value is less than this length, I have already checked in my table-

    Start

    Here, I call a DB procedure that fills my data. I verifyed and works nice!

    pro_generate (:P2_PARAM1);


    Here, I select the data obtained in the previous step

    Select tic_text

    in cont

    of t_reim

    WHERE f_type =:P2_PARAM1 ;



    Here, I need to set the value to display in my page field


    APEX_UTIL. SET_SESSION_STATE ('P2_CONTENT', CONT);  -< < < < < that doesn't work. I tried: P2_CONTENT: = cont; but does not


    end;

    END;


    Thanks in advance for the help.

    You can do all this declaratively by using dynamic actions, to try jQuery is like trying to swim before you can float.

    You can influence the value returned from JavaScript with this PL/SQL:

    HTP. PRN (cont);

    Then include a function of success (as described in the previous link) to run code like:

    success: function {(pData)

    $s ('P2_CONTENT', pData);

    }

  • Setting the value of the current element

    Hello. Can I set the value of the current time in my trigger when-validate-point without physical coding: block.item name? Can I set the value to: Person.Name to null in some way without using explicit code:

    : person.name: = null;

    The reason why I ask is because I'll be running similar validations for mutiple items and want to reuse the same code in several triggers when-validate-point without having to update the code.


    I tried, but it does not work:

    : system.current_item: = null;


    Any suggestions? Is it still possible?

    Hey,.

    Try in this direction:
    copy (NULL, name_in ('system.current_block') |'.) ' || name_in ('system.current_item'));

    Concerning
    Frane

  • SET THE VALUE TO VALIDATE THE VALUE IN THE APEX

    GOOD DAY MASTER

    PLEASE HELP ME ON THIS


    I HAVE A POPUP LOV (NOM_ELEMENT) COME TO THE DATABASE VIEW
    UNDER THIS POPUP LOV, I CREATED AN ACTION DYNAMICS (SETPOINT)
    WHERE WHEN THE USER CLICKS THE POPUP LOV (ITEM_NAME) AND TAKE AN ARTICLE
    IT WILL SET THE VALUE OF QTY_LEFT1 TO THE NAME OF THE CORRESPONDING ELEMENT.

    AND AFTER THAT, I TRY TO QTY_PCS1 ENTRY ACTION DYNAMICS (ALERT IN QTY_PCS1)
    IT DOESN'T WORK ANYMORE... HIS ONLY WORKS ONLY WHEN THE QTY_LEFT1 HAVE A DEFAULT VALUE.
    IF THERE IS A WAY?

    HERE IS THE LINK OF MY SAMPLE APPLICATION WHICH IS MY REAL APPLICATION

    http://Apex.Oracle.com/pls/Apex/f?p=67079:1:1702076887505601:

    HELP PLEASE...

    Hi Mike

    Use this dynamic Action

    Event-> loose Focus
    Type of selection-> elements
    Article-> P1_QTY_PCS

    Action-> to run the JavaScript Code

    Enter the Code below:

    var a = document.getElementById("P1_QTY_LEFT").value;
    var b = document.getElementById("P1_QTY_PCS").value;

    If (b > a)
    {
    Alert ("upper Qty");
    }

  • Setting the value of selectOneChoice to run

    Hello
    I need set the value of selectOneChoice at run time. During the loading of the Page I am creating RichSelectOneChoice object and currencyCode.setValue ("USD");
    When I check on the length it does not show 'USD' as element selected in the drop-down list where as background it sends USD for application downstream.
    How to get the SelectOneChoice value show that is selected at run time in code?

    Thanks in advance.

    Have you abandoned the currencyCode in the data control palette (in which case the selectitems will be generated index as values), if so, to set objective test the index as a default and see if it shows the correct value.

    If you wan to have values rather than indexes, you can use forEach. See this [forum post | http://forums.oracle.com/forums/thread.jspa?threadID=938840] for the sample code.

    Jean Lou

Maybe you are looking for