Possible bug in apex.server.process?

I was testing the documented new AJAX function apex.server.process and I noticed that I seem to get an error.
The documentation on the process can be found here:
http://docs.Oracle.com/CD/E37097_01/doc/ doc.42 /e35127/javascript_api.htm#BGBJEFDJ

I created an example where I have both called an Ajax function by using apex.server.process and another call button using pure jQuery. The use of jQuery works and returns "test", the apex.server.process gives an error.
I just follow the syntax has been documented so I don't think I did a syntax error.

I downloaded an example on apex.oracle.com
Workspace: Ajax
User: demo/demo

If you make changes to the application, make a copy first please.

Error returned with apex.server.process:

Error: parsererror - SyntaxError: JSON.parse: unexpected keyword

Documentation:

See also: see the documentation for jQuery jQuery.ajax for all other available attributes. The dataType attribute is set by default in json.

Solution when it returns plain text:

apex.server.process( 'AJAX_TEST',null, {"dataType": "text"});

Tags: Database

Similar Questions

  • 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.

  • 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.

  • Help with apex.server.process

    Hello

    I try to use the new function apex.server.process for and I seem to have some problems with it. The appeal itself seems to work very well as firebug it returns what to expect. It's just that I return the json string to an object, and this is what causes the problem.

    Here is my application process:

    DECLARE
    
      lv_json             VARCHAR2(4000 CHAR);
      lv_score            NUMBER(12);
    
    BEGIN
    
        --Will get the score from the database...
        lv_score := round(fm_apex.events_api.get_percent_complete(:P40_EVENT_ID,'TOTAL'));
        
        IF lv_score = 100 THEN
          lv_json := '{"success":true}';
        ELSE
          lv_json := '{"success":false}';
        END IF;
        
        htp.p(lv_json);
        
    END;
    

    And this is my javascript function:

    function checkScore(pThis) 
    {
        var getScore = apex.server.process(
            'IS_SCORE_COMPLETE_JSON',
            {
                pageItems: "#P40_EVENT_ID"
            }
        );
        
        if ( eval(getScore.success) )  {
            alert('This is successful');
            //doSubmit(pThis.id);        
        } else {
            openModal('notScoredFully');
        }
            
    };
    

    It is done when the answer is {'success': false} and Firebug, it is it was still evaluating true? Everyone can see what I'm doing wrong?

    See you soon,.

    Paul.

    1 / apex.server.process is asynchronous. You manage it as if it is not. You initiate the call and he went, in contrast to htmldb_get that works synchronously (= makes the browser to wait for return). You must use the function of success.

    Apex.Server.process JavaScript APIs

    The return value of the call to server.process is an object jqXHR, documentation on which you can find here: jQuery.Ajax | jQuery API Documentation

    I would just use same success if, as shown in the example in the documentation.

    apex.server.process ( "MY_PROCESS", {
      x01: "test",
      pageItems: "#P1_DEPTNO,#P1_EMPNO"
      }, {
    success: function( pData ) { ... do something here ... }
      } );
    

    So something along these lines:

    apex.server.process(   'IS_SCORE_COMPLETE_JSON'
                         , { pageItems: "#P40_EVENT_ID" }
                         , { success: function( pData ) {
                                        if(pData.success){
                                          alert('This is successful');
                                        } else {
                                          alert('This is NOT successful');
                                        }
                                      }
                           }
    );
    

    2 / default apex.server.process manages the return as a json data type value. It would be pointless to 'eval', he.

  • Problem with the AJAX server process

    Hi team,

    I use APEX 5.0, apex.server.process to update a collection, and this process uses "async = false" (I need it and can't remove that I want to wait for results before the next call is made)

    My code below

    function f_UpdateCollection(v_fixture, v_store)
    {
        apex.server.process
        (
            'UPDATE_FIXTURE',
             {
                x01: v_fixture.checked,
                x02: v_fixture.value,
                x03: apex.item('P46_PARENT_PAGE').getValue(),
                x04: v_store,
                x05: apex.item('P46_PLAN_ID').getValue(),
                x06: apex.item('P46_BU_ID').getValue()
           },
           {
                dataType : 'text',
                async: false,
                success : function(pData)
                {
                     //alert(pData);
                },
                loadingIndicatorPosition:'page'
           }
        );
    }
    
    

    The question is as soon as I put async = False, my loading indicator stops working and the page looks like hanged for about 10 seconds. I want this to work with async = false. If I withdraw this statement, indicator of loading works fine. Can someone Guide, how can I use indicator of loading with async = false;

    Thank you

    Sunil Bhatia

    Hello

    You can collect the values of table and box to pass the application process.

    This way you only call once your process.

    But I'm not well understood what you are trying to do.

    Kind regards
    Jari

  • APEX 5.0 Bug: apex.server.plugin pOptions is not defined

    When you call apex.server.plugin with just the identifier of the AJAX (i.e. no pData or pOptions) the following error occurs:

    TypeError: pOptions is undefined


    What happens in server.js on line 429...


    if ( pOptions.queue ) {


    As the docs says that pOptions is optional https://docs.Oracle.com/CD/E59726_01/doc.50/e39149/javascript_api.htm#AEAPI29511 , I think it is a bug.


    When passing to a JSON null pOptions, traverse AJAX request object (confirmed this via the logging on the server), however, there is an error on the page via an alert message. Example:


    apex.server.plugin(
      myAjaxIdentifier,
      {
        x01: 'test'
      },
      {}
    );
    


    The following error message is displayed in an alert message: error: parsererror - SyntaxError: JSON.parse: unexpected end of data to column 1 of line 1 of the JSON data

    Hi Martin,

    Thanks to and for reporting this bug. I entered a bug and we will try to fix it in a version of the patch. For now, labour is about to pass an empty object to pOptions. Regarding the error you get when you do this, take a look at the answer. It cannot be valid JSON. If the response data are not JSON or there is no response data (204 no content) then you will need to use pOptions to specify the response format using the dataType pOption property. See the jQuery for this doc.

    When I tried passing an empty object I don't have the parsererror.

    Thank you

    -John

  • APEX translated application 4.2 available possible bugs on theme 25

    Hello everyone,

    I try APEX 4.2 with reactive Blue theme (theme 25). So far so good. When I tried to do an application translated from my one shot (I don't translate any string, just de-seeded and released the app), I discovered some possible bugs on the page layout. For example, in areas of form, fields with the scope of auto column cannot be aligned in the same line. They are moved to a new line, although in the original application, it works. I know it's easy to fix by setting a specific value in the scope of column. But how can I fix the page layout in the pages who are magicians (with the standard model of region) and fields are placed in the table not div like in the initial application. Is there a difference between a translated application (which is actually not yet translated) and on the initial page rendering?

    Thanks in advance.

    Hi Grandmaster,

    I think that you are hit bug 15922307 - model of presentation of the grid of a translation application is not used
    who sets us 4.2.1.00.08. Can you check if you're on this version or if you are still on APEX 4.2.0

    Concerning
    Patrick
    -----------
    Member of the APEX development team

    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Possible bug on role assignments

    I am using SOA/BPM 11.1.1.7.

    I found a possible bug when you deploy a BPM Application which mixed assignments (some directly to one user, others to a role of Application BPM (created in the workspace).

    I did two tests.

    Test 1.  Created a project/process of BPM with two lanes.  In organization, I assigned the roles of corridor users (to the embedded Weblogic LDAP).  On deployment, these roles were driven from the area space of work/Administration/roles (when logged in as a Weblogic).

    Test 2.

    In the workspace I created a few BPM roles (and put assignments users), then in a project of assigned BPM Application roles to my role of corridor.

    However, I created a corridor and made the assignment directly to the user.

    On deployment, the role which has been directly attributed to the user at the level of BPM projects has been eliminated NOT to the role area.

    A video of it is here: http://youtu.be/bWtEIRavlEY

    Stuart

    Hi Stuart,

    Could check you how your mapping roles work if you check "deployment of existing objects of update on ' option in organization.xml?

  • How to discover the server process?

    Hello

    I have the Oracle XE installed on XP. I've connected to the database using SQL * MORE. I want to know the name of created the client process, server process (i.e. SQL * MORE). How do I know the created server process. Please suggest?


    Thank you
    Aravind

    >
    I want to know the name of created the client process, server process (i.e. SQL * MORE).
    >

    Since you are under Windows, there is no process of server created to establish a session with the SQL * Plus process. On the contrary, a thread in the Oracle.exe process is created.

    Other than correspondence network opened by the wire and SQL ports * more the process, I can't think of another way to figure out which thread is associated with which process.

    John.

    PS: since both the client and the host are on the same machine, if the communication between the two processes is done using IPC then there are no ports to match.

    Published by: 440bx - 11 GR 2 on 15 Sep, 2010 13:54 - added the possibility of the IPC.

  • Possible bug in a Select NULL-option list

    Hi all
    I tried to use a list to select a tabular form and found a possible bug.
    I have reproduced the issue on apex.oracle.com.
    Please visit http://apex.oracle.com/pls/apex/f?p=38499:2.
    It seems that the fields for 'Display value Null' and 'return Null value are switched.
    Can someone try this and tell me if I'm doing something wrong or it's really a bug?

    Kind regards
    Moritz

    Hello

    what I saw bug # 10095760 has been filed for this issue.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Translated from possible bug in export of text Messages

    Hello

    I'm trying to export the repository of text Messages, and I get the character "" for all non-Latin characters. As I get the same result on apex.oracle.com and on my local instance I guess that the problem is not with the database or the DAD character set. Is it possible that specific to this process, a value of APPLICATION of FLOW_EXCEL_OUTPUT_R496331286_en-we uses its own set of characters (non-Unicode)?

    A deposit of test text Messages is located in application 50888 on apex.oracle.com (workspace: sham_test).

    Appreciate any idea on the subject,
    Arie.



    -------------------------------------------------------
    & diams; Be sure to mark the appropriate fix/useful messages. For the long term, it will benefit us all.

    & diams; Forthcoming book on APEX: Oracle Application Express 3.2 - The Essentials and much more

    Hi Arie,

    How are you?

    What you see is a by-product of the automatic encoding of CSV feature. Automatic encoding of CSV is set to 'Yes' for the Application Express Application Builder. With this feature enabled, the CSV files are coded such that they are compatible with localized versions of MS Excel. Without this feature, the generated CSV file would still be generated in utf-8 format, which MS Excel could choke in certain geographical areas (American, German, Japan).

    'Something", you can use is to temporarily run the Application Builder in the language of the browser 'hi. ' Hindi is one of the languages in the Application Express which has the game mapped to AL32UTF8 characters CSV. In this way, you will get a file that you will not be able to open directly in MS Excel, but you are also suffering the character set conversion issues.

    Does make sense? I hope this helps.

    Joel

  • Are you aware of a possible bug in the version 3.6.23? In the browser, for example, "two /" appears with the slash through the 'o'. Is this a known bug? Thank you

    Are you aware of a possible bug in the version 3.6.23? In the browser, for example, "two /" appears with the slash through the 'o'. Is this a known bug?

    When the same text is seen in another browser, it is displayed correctly as "two."

    The same question is displayed on another computer.

    Thank you.

    Sounds that you use a font that supports ligatures (Palatino?).

  • possible bug in match pattern string of dot and a special character

    Hi friend recently and I find something in game chain model that it looks like bug, I want to know labveiw expert opinion on it
    the possible bug is
    have you ever tried to match (.) dot for use in regular expression? this icon could not find the point inside the string? 
    I also think what happens if we try to find a character within a string that is a piece of special character
    for example how you can use this icon to find \b inside the string as (hatef\blabview)?

    [.] to find the period

    \\B to find the backslash b

  • Windows Server 2008, the server process could not be started because the configured identity is incorrect. Check the user name and password.

    When I started and connect to the windows 2008 Server and when trying to open any folder I get the below error message:

    The server process could not be started because the configured identity is incorrect. Check the user name and password.

    Please give me your entries for this problem.

    Kind regards

    Shankar Kale

    Hi Shankar,

    The question you posted would be better suited in the TechNet Forums. See the link.
    Hope this information helps.
  • Possible bug: save the table with double and extended precision to the worksheet

    If one concatenates an array of double-precision and an array of precision extended with the 'build' vi table, then recorded using 'Write in a spreadsheet file' vi any digits to the right of the decimal are reset to zero in the saved file. Regardless of the entry of signifier of format (for example %.10f) to the vi 'Write in a spreadsheet file'.

    I'm on Vista Ultimate 32 bit and labview 9.0

    This is a possible bug that is easily circumvented by the conversion of a type before you incorporate arrar in a worksheet. Nevertheless, it's a bug and it cost me some time.

    Hi JL,.

    No, this is not a bug - it's a feature

    Well, if you'd look closer you would recognize the 'save to spreadsheet' as polymorphic VI. As this polymorphic VI does not support the EXTENSION numbers internally (it only supports DBL, I64, and String) LabVIEW selects the instance with more precision: I64 (I64 a 64 bits of precision, DBL that 53...). Your options are:

    -the value of the instance to use as the DBL (by right click and "Select type... »)

    -make a copy of this VI, save it under a different name and make support number of POST (not rework the polymorphic VI like you would break compatibility with other facilities of LV or future revisions)

Maybe you are looking for