Pass the parameter to the javascript application process

I'm trying to pass a parameter to an application process from javascript and don't know how to do this. What I want to accomplish is to create checkboxes to delete several records at once. Before these records can be deleted, I need to make sure that the resource_type_id is not used. To do this, I call a javascript function with an onchange event that calls an application process to perform a database search. I have included the code to create the boxes and the JavaScript below. I am new to APEX, so there may be a way easier and better to do. Any help or suggestion about a better way to proceed would be appreciated.

Thank you!

Creation of boxes *.

SELECT APEX_ITEM. CHECKBOX (20, RESOURCE_TYPE_ID, 'onchange = "CheckUsed (this.value)" '; ':') "Delete", RESOURCE_TYPE, APEX_ITEM.text(10,RESOURCE_TYPE_ID) RESOURCE_TYPE_ID
OF resource_types
ORDER BY RESOURCE_TYPE



< script language = "JavaScript1.1" type = "text/javascript" >
function CheckUsed (id)
{

get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is ResourcesResourceTypeExists', 0);

Alert (Get.get ());
}

NP, help!

Andy

Tags: Database

Similar Questions

  • Pass the JavaScript array to the method java plugin

    Hello
    How can I pass an array from javascript to java method?
    I've specified java method as type '[MyClass =" param in vso.xml
    But, I am getting error in passing the following Javascript to the Java method:
    "Could not convert 7.6897897E7 in [MyClass].
    Concerning
    Sameer

    Hi Sameer,

    Your Java method signature expects 4 parameters, but you are passing 5 your JavaScript action. There is an extra parameter (the contextId) I think, which causes timestamp be mapped to layer2FirewallRules . This is why it is said that it is unable to convert a number to a table.

  • How to pass the Javascript function OBJECT

    Hello

    I have 2 items.

    P1_ITEM1
    onchange="javascript:function1(this); // here we are passing the object (THIS) for P1_ITEM1
    {code}
    
    
    P1_ITEM2
    {code}
    onchange="javascript:function2(this); // here we are passing the object (THIS) for P1_ITEM2
       
    // how can I pass the object of P1_ITEM1.
    onchange="javascript:function3(xxxx); // here I want to pass the object for P1_ITEM1
    {code}
    
    
    Thanks,
    Deepak                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Deepak

    Change the function definition for a pThis parameter to start - it's confusing otherwise.

    For your last example, modify the parameters for the function to be () (Nothing) and then have the first line of another function as

    var pThis = document.getElementById('P1_ITEM1');
    

    Then use pThis as object...

    See you soon

    Ben

  • Get all the hidden Application processes

    Hi all

    There are Application processes that are running on Blackberry which are not visible Application. In the application manager, we can get only visible applications. How do we get all processes including hidden processes? What api gives all processes other than ApplicationManager?.

    Thanks in advance

    Have you seen this?

    http://kisses.zensay.com/

    Developer says he is gong to open source its code at some point.

  • Call javascript application process

    I use 5 APEX. I have a page that I use a button to call js and dynamic action.

    I created the button on my page with action "Defined by the dynamic Action" and static id "ajax".

    I added this js on my page 'function and declaration of global variables ' section:

    $('_#ajax').click (function () {}

    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is getId', 0);

    var ajaxResult = ajaxRequest.get ();

    Alert (ajaxResult);

    $.ajax({)

                 url: " http://10.25.7.84/WS/selectionService/currentSelection/student ",

    type: 'POST',

    data type: 'json ',.

    contentType: "application/json",

    data: ' {'mode': 'set', 'ID': "[" + ajaxResult + "]","page": 1, "pageSize": 20 "}'

    });

    Alert (' we need to find a better message - value current selection complete ');

    });

    I have created a process called 'getid ':

    DECLARE

    p_app_id NUMBER: = 100;

    p_page_id NUMBER: = 13;

    BEGIN

    ...

    END;

    2 questions:

    (1) I want this application process to be reusable for multiple pages/applications, so I need to replace the hard-coded "p_app_id", "p_page_id" with something I can put on each page. What is the best way to do it? Elements of the application? How and where should I set up on the page?

    (2) in my js, I don't want to hard-code the IP address in the URL.  url: "http://10.25.7.84/ws/selectionservice/currentselection/student". "" Y at - it something that I can use so that it uses the IP that APEX was running on?

    Hi bobmagan,

    bobmagan wrote:

    I tried, but it doesn't seem to work. The application process worked when I had coded the 2 variables. Don't know if its something in the code, that's why I've included pieces that use 'p_app_id' and 'p_page_id '.

    You can access the app ID and the ID of the Page in javascript and send it to your AJAX process as follows:

    • JS code:
    $('#ajax').click(function(){
        var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getId',0);
        ajaxRequest.addParam('x01',$x('pFlowId').value);
        ajaxRequest.addParam('x02',$x('pFlowStepId').value);
        var ajaxResult  = ajaxRequest.get();
        //alert(ajaxResult);
        $.ajax({
            url: "http://10.25.7.84/ws/selectionservice/currentselection/student",
            type: "POST",
            dataType: "json",
            contentType: "application/json",
            data: '{"mode":"set","ids":"[' + ajaxResult + ']","page":1,"pageSize":20}'
        });
        //alert('We need to find a better message - Set Current Selection Complete');
    });
    
    • AJAX PL/SQL process:
    DECLARE
    
        p_app_id   NUMBER := APEX_APPLICATION.G_X01;
        p_page_id  NUMBER := APEX_APPLICATION.G_X02;
    
    BEGIN
      ...
    END;
    

    Kind regards

    Kiran

  • A question about the job application process

    Hey.

    Recently, I applied for the post of trainee on "jobs.apple.com.

    I guess that I have completed successfully, it causes, I received the email telling me to wait until a recruiter turns to me.

    But after about 3 weeks I'm still nothing happens.

    One point that caught my attention is the menu of 'Activity', 'Submissions' Party it shows my time submit but the 'Questionnaire' part is empty.

    Should I do something about it?

    Also, is there a way that I can follow the process and be aware of what is happening to my presentation now?

    Regrads, Madrassah.

    Don't worry, part "Questionnaire". It may take as long as six weeks before receiving any communication. Unfortunately, Apple does anyway in response to your presentation.

    Good luck with your job search with Apple!

  • Call AJAX process and pass the value on request

    Hello
    I want to call a process on demand by a button. So I added the following for her javascript code:


    function update_bp1()
    {
    Alert ('hhhhi');
    Alert (document.getElementById('P11_PATIENTID').value);
    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is update_bp', 0);
    ajaxRequest.add ('patient_id1', document.getElementById('P11_PATIENTID').value);
    ajaxResult = ajaxRequest.get ();
    Alert (ajaxResult);
    }
    < /script >


    The called application process is:

    declare
    number of v_id;
    number of v_visitno;
    v_patientid varchar2 (10);
    BEGIN

    Select max (id), max (VISITNO)
    in v_id, v_visitno
    of TBL_PATIENT
    where PATIENTID =: patient_id1;

    Update TBL_PATIENT
    the SYSTOLIC value = 10,
    DIASTOLIC = 20
    where id = v_id
    and visitno = v_visitno
    and patientid =: patient_id1;

    commit;

    HTP. PRN ('process value'-|: patient_id1);

    end;

    It seems there is error in the ajaxrequest.add clause, as after commenting on the function is executed. Alert print correctly the value P11_PATIENTID.
    The alert of the ajaxresult gives the complete HTML code and the process is not running. How interpreet ajaxresult error.

    Please help me to identify the problem.

    Thank you

    Hello

    I think that it is not relative browser, but Firefox with the module Firebug is just a better tool for web developer.
    It is easier to debug problems you have now.

    Is the point of application patient_id1? You need also to pass the value to the application process?
    If you don't need it another vise, it is better to use variables global apex_application

    Try this
    JavaScript for HTML page header

    
    

    Then, create the new process On demand application named UPDATE_PATIENT. Please note that the name of this process is case sensitive.

    DECLARE
      v_id        NUMBER;
      v_visitno   NUMBER;
      v_patientid VARCHAR2(10);
      v_count     NUMBER;
    BEGIN
      SELECT MAX(id),
        MAX(visitno)
      INTO v_id,
        v_visitno
      FROM tbl_patient
      WHERE patientid = apex_application.g_x01
      ;
      UPDATE tbl_patient
      SET systolic  = 10,
        diastolic   = 20
      WHERE id      = v_id
      AND visitno   = v_visitno
      AND patientid = apex_application.g_x01
      ;
      v_count := SQL%ROWCOUNT;
      COMMIT;
      htp.prn(v_count || ' rows updated');
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
      htp.prn('error: patientid ' || apex_application.g_x01 || ' not exists in tbl_patient');
    WHEN OTHERS THEN
      htp.prn('error: ' || sqlerrm);
    END;
    

    Kind regards
    Jari

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

    We were spending the entirety of our method of apex.server.process htmldb_get request the favorite (and documented and supported!). It has worked well so far for the AJAX JavaScript process call, as long as the process of AJAX in question was one * Page * level process. However, when we try to eat a * application * process, it just doesn't seem to work.

    For the examples below, we have two elements of Application named PRS_PRODUCT_PROFILE_ID and PRS_PROFILE_OPERATION. We have a process to request on request (* not * a process page!) named MAINTAIN_PRODUCT_PROFILE_2.

    Here are the previous htmldb_get approach (which works fine):

    function resynchronizeProductProfile (productProfileID)

    {

    var profileOperation = 'EDIT_PROFILE ';

    var ajaxRequest = new htmldb_Get (null, $v ('pFlowId'), 'APPLICATION_PROCESS is MAINTAIN_PRODUCT_PROFILE_2', 0);

    ajaxRequest.add ("PRS_PRODUCT_PROFILE_ID", productProfileID);

    ajaxRequest.add ("PRS_PROFILE_OPERATION", profileOperation);

    var resynchronizeResult = ajaxRequest.get ();

    ajaxRequest = null;

    Return resynchronizeResult;

    }

    Here's the (what I think is the) same call using the new approach of apex.server.process:

    function resynchronizeProductProfile (productProfileID)

    {

    var resynchronizeResult;

    $s ("PRS_PRODUCT_PROFILE_ID", productProfileID);

    $s ('PRS_PROFILE_OPERATION', 'EDIT_PROFILE');

    Apex. Server.Process ("MAINTAIN_PRODUCT_PROFILE_2"

    , {pageItems: ' #PRS_PRODUCT_PROFILE_ID, #PRS_PROFILE_OPERATION '}

    , {dataType: "text"}

    Async: false,

    complete: function (ajaxResponse)

    {

    var resynchronizeResult = ajaxResponse.responseText;

    }

    });

    Return resynchronizeResult;

    }

    However, in the new version, arguments don't appear to be preparing when the MAINTAIN_PRODUCT_PROFILE_2 application process is called. PRS_PROFILE_OPERATION, for example, is on "even if above, you can see that it is, in fact, pre-programmed on 'EDIT_PROFILE '.

    As a general rule, the call to apex.server.process sets the item values in the page and in the session in a single step. This doesn't seem to be the case with elements of the Application (although it works very well for the items on the Page).

    What's up with that? Everyone see my mistake?

    Thank you

    -Joe

    Post edited by: Joe Upshaw

    Joe,

    Using the pictures I showed you can simply use your application objects in the process. This is exactly the same as what htmldb_Get: when you use. add(), you provide a key pair / value that will be added to the respective tables, it is just behind the scenes. By manually adding to the table with apex.server.process, you get the same exact behavior and apex define elements of page/application corresponding to the value in the table of p_arg_names with the value in the p_arg_values table.

    When test you it in your demo application by assigning the value of the page element, and then using the 4 button (point), you can see that the question of the application session state has changed by inspecting the session state of the elements of the application through "session" in the developer toolbar. (it's in the "apex of ajax samples - forum" app)

    Of course, you can use the scalar parameters x # to provide values for the process, but why would you do the extra arch? If the elements of the application would set the restrictions, you still get the same result as if they were not, and they are easily manipulated through the same ajax call. I added an extra button with an ajax call using x 01. I never had problems with the help of the scalar parameters.

  • Generic procedure for the development of the item application of javascript?

    For now, all I can think about is a javascript function call to an application process, which looks like this:

    function setVariableValue (pName, pValue) {}
    var gReturn;
    get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is odpSetVariableValue', 0);
    get.addParam('x01',pName);
    get.addParam('x02',pValue);
    gReturn = get.get ();
    get = null;
    }

    odpSetVariableValue
    Start
    immediate execution ':' || wwv_flow.g_x01 | ' := ' || wwv_flow.g_x02;
    end;

    Is there a function of APEX to do without "immediate execution"?

    Igor

    Hello Igor.

    I think you can do the same thing without actually executing a PL/SQL process (see here for an example).

    function setVariableValue (pName, pValue) {}
    get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is dummy', 0);
    Get.Add (pName, pValue);
    var gReturn = get.get ();
    get = null;
    }

    (The dummy application process are really...)

    Greetings,
    Roel

    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.Logica.com/

    You can assign this answer to your question in marking it as useful or Correct ;-)

  • Application process JavaScript

    Hello

    I want to run a JavaScript application process to update a table.

    JavaScript:
    function update_seq() {}
    get var = new htmldb_Get (null,
    & APP_ID.,.
    'APPLICATION_PROCESS is update_rep_seq',
    (0);

    gReturn = get.get ();
    get = null;
    }

    At the request of PL/SQL
    BEGIN
    INSERT INTO jmv_temp VALUES (SYSDATE, "in_process");
    COMMIT;
    EXCEPTION WHEN OTHERS THEN
    HTP.p (' error: ' |) SQLERRM);
    END;

    If I run the process from a URL, it inserts my record.
    .../f?p=500:4:465882208613569:APPLICATION_PROCESS=update_rep_seq

    If I call the JavaScript from an element to the file didn't get inserted. Finally, I wish to pass parameters to do an update on a table.

    No idea why the JavaScript call does not work?

    Thank you

    Melvin

    Hello:

    Try if change the last parameter in the 'htmldb-get' call from 0 to 4 makes a difference

    CITY

  • Running APEX application process

    Hello!

    Application process (with htp.p in it) is not running when onSubmit process page returns the error (and shown in the notification bar).

    How can I make the process to run? Or is it a bug?

    You can see example in the application of test Report 1

    Just press the "SUBMIT" button and see difference about the expression "'application process is here" at the top. "

    Thank you!

    You can do this by using a chain of substitution as mentioned above. Rather than display the results of the query of the user using lifestyle htp.p , create a USER_STYLES application point and store them in it:

    declare
      l_user_styles varchar2(4000);
    begin
      for cur in (select t.param, t.value
                      from USERDATA t
                    where t.authid = :APP_USER
                        and t.application = :APP_ID
                        and t.page = :APP_PAGE_ID) loop
            l_user_styles := l_user_styles || '#' || cur.param || ' {' || cur.value ||'}');
      end loop;
      :user_styles := '';
    end;
    

    The application can then be referenced in heads of page template using the substitution string syntax:&USER_STYLES.

    This approach is more effective than what you try to do what the style of the user information must be defined in the application element when connecting and when the styles are changed, rather than on each page show that you propose.

  • Pass the value to the process of request through javascript

    Hey everybody,

    I am currently struggling with the call to an application process and passing a value to it through javascript. Ideally, my javascript is triggered by a dynamic action, which itself is triggered when a user changes the value of a selection list. Below is the javascript code that is relevant:

    for (k=0; k<active_array.length; k++){
          var request = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=CAL_COLORS', 0);
          request.add('x01', check_array[j]);
           var ajaxResult = ajax.get();
           alert(ajaxResult);
          active_array[k].parentNode.style.backgroundColor=document.getElementById('P14_TEST_COLOR').value;}
    

    And she calls the application process is also shown below:

    declare
    v_color varchar2(20);
    begin
    select color into v_color from cal_colors where other_user = apex_application.g_x01 and user_id = :USER_ID;
    :P14_TEST_COLOR := v_color
    end;
    

    The issue seems to be that online 03 my JavaScript, especially since my array element is not spent properly in my process. In an attempt to debug this, I added the alert message, however, instead of any relevant information, the alert shows just the HTML page! I'm at a loss as to what I'm doing wrong here, so if anyone has any input, I would very much appreciate it.

    Basically, you need to rewrite in the http buffer, using htp.p:

    DECLARE
      v_color VARCHAR2(20);
    BEGIN
      SELECT color
        INTO v_color
        FROM cal_colors
       WHERE other_user = apex_application.g_x01
         AND user_id = :USER_ID;
    
      htp.p(v_color);
    EXCEPTION WHEN no_data_found THEN
      htp.p('white');
    END;
    

    You could potentially make it much more efficient also. At the present time you loop on what is probably an array of elements, so from a tabular form probably. Rather than call an ajax for each line, you can group together them and make a call.

    Example:

    JS, you can use this to create an array with values to be placed on the server:

    var lArray = [];
    $("input[name=f03]").each(function(){
    lArray.push($(this).val());
    });
    

    And you can use the apex.server.process api to call a process on demand:

    apex.server.process("MYPROCESS", {f01: lArray}, {success: function(pData){console.log(pData);}})
    

    As you can see, the table with the values is put in the table in the f01. You must use the option of success well since it will be asynchronous (htmldb_Get.get is a synchronous call).

    With respect to the CLASS code:

    DECLARE
      l_return VARCHAR2(4000);
    BEGIN
      FOR i IN 1..apex_application.g_f01.count
      LOOP
        l_return := l_return || '"VALUE' || i || '",';
      END LOOP;
    
      l_return := RTRIM(l_return, ',');
      IF l_return IS NOT NULL THEN
        l_return := '[' || l_return || ']';
      END IF;
    
      htp.p(l_return);
    END;
    

    It will loop through the items in the table-f01 and build a new JSON notation and write it back to the http buffer so it returns to the client. It will look like this:

    ["VALUE1", "VALUE2", "VALUE3", "VALUE4", "VALUE5", "VALUE6", "VALUE7", "VALUE8", "VALUE9", "VALUE10"]
    

    I say this because when users use your application, you do not want such a quantity of calls. A single call by treatment action would save a lot of resources. You may have to loop twice on your items to apply your backgroundcolor, but I don't voluntarily not too mention jQuery since you is perhaps not familiar with it and get scared by him.

  • How to pass the value of the item Application Javascript function.

    Hello

    I have the JavaScript in the properties attribute of the HTML Form element

    I'm on page 1 and passing the value of the item page P1_DEPT_NO. It is perferctly working very well and I am able to get the exact value of the element on the page
    onchange="javascript:function1($x('P1_DEPT_NO').value);"
    I'm on page 1 and passing the value G_DEPT_NO of the Application element .
    The problem here is, I don't get the point of Application inside the javascript function value.
    I tried to use alert(); and it gives me the undefined value
    onchange="javascript:function1($x('G_DEPT_NO').value);"
    I just want to know, How to pass the value of the Application in Javascript element.

    Thank you
    Deepak

    Deepak,

    I'm not a Javascript expert, but the suggestin I did was because the javascript is a case-sensitive... language and thats why onChange is not the same thing as onchange.
    Not sure if this is causing the problem.

    Application elements not associated with a page and have therefore no properties user interface.
    So, as mentioned in another post, the rendering would not work for the elements of the application.
    If it is for a single item, used only on this page, you might create a hidden page element and use it fo your goal

    If you want to keep watching objects application and AJAX, this page contains examples of using AJAX to solve problems like the one you mentioned.
    http://www.Oracle.com/technology/OBE/hol08/apexweb20/ajax_otn.htm#T1B

    Thank you
    Rajesh.

  • Pass the parameter of application deployed in the ADF library jar file

    Hi all

    I use JDeveloper 11.1.2.4.0, i have 2 Applications appA, appB.

    I created in taskflow appA containing departments viewobject, appB contain stubborn workflows which has Employee.jsff page.

    I have deployed appB as library of ADF jar file and add it to appA, I need to pass the id of employee viewobject, Department

    Kind regards

    Hello

    In order to create a business application, are usually required several workflow tasks. These workflow will perform different functions, but they may have to communicate with each other. To enable this communication, you can use task flow settings, contextual events or sharing of the data control Instances.

    Please check below link

    Java / Oracle SOA blog: events ADF passing between areas of workflow

    Communication between task flow using the flow of the task - Waslley Souza Blog settings

    Thank you

    Amey

  • To access the settings of ajax in the application process

    Hello

    I have an ajax call, submitting a parameter called cBoxKey.

       var get = new
       htmldb_Get(null,$v('pFlowId').value,'APPLICATION_PROCESS=TrackRows',0);
       get.add('cBoxKey','NOTREQUIRED');
      get.get();
    
    

    In the application process I can access the parameter 'cBoxKey' like below;

    declare
        l_checkBoxKey  varchar2(4000);  
    begin
        --
        -- Get the value of the global which will be set in JavaScript
        --
        l_checkBoxKey := wwv_flow.g_cBoxKey;
    
    

    However, this does not seem to work because when I replace

    l_checkBoxKey := wwv_flow.g_cBoxKey;
    
    

    with

    l_checkBoxKey := 'NOTREQUIRED';
    
    

    The application process is called and produces results (through the ajax call).

    In my view, that the question is how access the "cBoxKey" parameter in the application process.

    Any ideas on what could be wrong.

    Thank you.

    Hello

    I check any specification of package APEX version wwv_flow, there is no variable of g_cBoxKey.

    If you have idea there?

    Change your JavaScript for

    var get = new
    htmldb_Get(null,$v('pFlowId').value,'APPLICATION_PROCESS=TrackRows',0);
    get.addParam('x01','NOTREQUIRED');
    get.get();
    

    And then access process on demand as

    l_checkBoxKey := APEX_APPLICATION.g_x01;
    

    Kind regards
    Jari

Maybe you are looking for

  • address book is not displayed when transmitting messages

    When I send a message from my address books don't show in the sidebar so that I can choose to send to.

  • GoDaddy IMAP problems after 10.11.2

    After the update to OS X 10.11.2, I have a very annoying problem with one of my IMAP accounts that have 5000 + messages in the Inbox of reception and sent items. Send messages re - download app (can't say exactly how many times, but several times a d

  • How to remove the sidebar in XP home SP3

    How remove the sidebar of Windows XP I've reached by dragging the icon my computer next to the office, please

  • Cannot access a shared folder

    I have a network that uses a multude of different types of computers with different operating system, but most of the positions are Win XP or Win 7.  I am able to access a drive on the part of all but one.  The error I get is "the specified network n

  • HP Pavilion 17-e119wm: what to do after replacing hard drive

    Hello, I bought a laptop HP Pavilion year last for work or school. He perfectly managed until yesterday when it was freezing to close unexpectedly. Waited about half an hour to see if it would work himself, I had several programs running at the same