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!

Apex.event.trigger to trigger a dynamic action in interactive grid gives err-1002 unable to find ite

CaribbeanUserNov 28 2019

Hi,

I'm using Application Express build 19.2.0.00.18. I've created an interactive grid region and defined a dynamic action (Event=Change) on a column (SAL) that changes the value of another column (TAX) with

True Action = Execute PL/SQL Code =

begin

  :TAX := :SAL * 0.2;

end;

Item SAL is submitted and item TAX is returned by the action.

When the value of column SAL is changed, the value of column TAX gets updated as expected. I've also defined a rowactionmenu 'Calc Tax' like so:

$(function() {

    // listen for view change events to find out when grid views are created

    $("#interactivegrid").on("interactivegridviewchange", function(event, data) {

        if ( data.view === "grid" && data.created ) {

            var view = apex.region("interactivegrid").widget().interactiveGrid("getViews", "grid"),

                menu$ = view.rowActionMenu$;

            menu$.menu("option").items.push({

                type:"action",

                label:"Calc Tax",

                action: function(menu, element) {

                    var lCancelEvent;

                    lCancelEvent = apex.event.trigger('#salCol', 'change');

                   

                }

            });

        }

    });

});

Column SAL has static id 'salCol'. When I select the action 'Calc Tax' from the row menu, the dynamic action gets fired (I know this because the first True Action is an alert), but when an attempt is made to execute the PL/SQL Code, an ERR-1002 is raised.

However, when I first manually change the value of the SAL column of any row after initial page load, and then invoke the row action 'Calc Tax', the application behaves as expected.

Any help in understanding the problem is highly appreciated.

Many thanks,

Ibrahim

The 'problem' is reproduced in:

https://apex.oracle.com/pls/apex/f?p=107085:1

Comments
Post Details
Added on Nov 28 2019
0 comments
2,257 views