Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JSON to return multiple values and multiple rows

HarryFApr 28 2014

I have an on demand process that does an update then I want it to return a string/object and I want to use that return value to update items in a tabular form without submitting the page.

The data would look something like this:

[{"TYPE_ID":"100","TOTAL":"70"},{"TYPE_ID":"200","TOTAL":"25"},{"TYPE_ID":"300","TOTAL":"50"}]

Then when I am updating page items when I encounter a TYPE_ID I would get the total for that TYPE_ID

trname = this.triggeringElement.name;

apex.server.process("GET_TOTAL",

  {"x01":firstSeqField},

  {dataType: "text", success: function(pData){

//pData would contain a string or json object returned from GET_TOTAL?

    $('input[name="' + trname + '"]').each(function(){

      row = apex.jQuery(this).closest('tr');

      totField = row.find('[name=f12]');

//javascript to get total for type

      totField.val(whatever I get for the type);

    });

}});

Is JSON the preferred method?

Is the return value from the on demand process a json list or a string? What is the code for manipulating that string when there are multiple rows?

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 26 2014
Added on Apr 28 2014
0 comments
995 views