1

Topic: Error at performance AJAX.

On the form is available two select list. At change of one it is caused DA with the code:

apex.server.process ("AJAX_GET_DATA";
{x01: apex.jQuery (' #P47_SL ').val ()};
{dataType: "JSON";
loadingIndicator: ' #P47_LT ';
success: function (pData) {
$(' #P47_LT ').empty ();
for (var i = 0; i <= pData.length; i ++) {
$(' #P47_LT ').append (' <option value = "' + pData [i].ID + '"> ' + pData [i].FIO + ' </option> ');
}
console.log (pData);
}
});

Code AJAX Callback

DECLARE
v_json varchar (1024);
v_json_res varchar (1024);
BEGIN
for i in (select t.fio, t.id
from users_data t
where t.id_group = apex_application.g_x01
order by t.fio)
loop
v_json: = v_json || ' {' || ' "ID": ' || i.id || ', ' || ' "FIO": "' || i.fio || '"}, ';
end loop;
v_json_res: = ' [' || substr (v_json, 1, length (v_json) - 1) || '] ';
Htp. Prn (v_json_res);
END;

I.e. at change of one sheet in another should  the data corresponding to selected value. And basically all works, but is constant in the console there is an error (the screenshot see). In what the reason of the given error and on what it influences?

2

Re: Error at performance AJAX.

Cheerful, here:

for (var i = 0; i <= pData.length; i ++) {

And generally what for such complexities if are property cascading lov parent item and the regular mechanism of update of dependent lists?

3

Re: Error at performance AJAX.

non-apexoid, did not understand, what there?
Further I plan to transfer it on select lists in Tabular Form. And as them there to make dependent and did not understand.

4

Re: Error at performance AJAX.

The cheerful;
Less should be strict, without equality

for (var i = 0; i <pData.length; i ++)

The last coil superfluous, such is not present an element,  and an error

5

Re: Error at performance AJAX.

For understanding.
For example, in an array of 10 elements. The indexing  goes from zero. Therefore the last element we will have an index 9.

6

Re: Error at performance AJAX.

blkangel, thanks for the explanation smile