This discussion is archived
3 Replies Latest reply: Jun 14, 2013 4:48 AM by kgamble RSS

custom dynamic action not firing

kgamble Newbie
Currently Being Moderated

Using Apex 4.2.2 on 11g

 

I have a standard report A1

There is a column link on report A1 which refreshes chart C1 using a custom dynamic action.

 

The column link on report A1  has the URL set to  javascript:$.event.trigger('RefreshTrend_2', [{key_2:'#COL01#' }]);

and there is a dynamic action D1 RefreshTrend_2 which sets the value of the chart filter P17_KEY_2 to the value of the javascript variable key_2 and then refreshes chart C1

The dynamic action is custom with a type DOMObject of document and no condition

 

This works fine but when I add another report/chart (report A2, chart C2)  combination with a similar dynamic action (D2), D2 is a copy of D1 with the values for the variables and chart region changed.

 

The A2/C2 functionality works fine on its own, D2 gets fired when I click the column link, but not when there are 2 dynamic actions of custom/document on the page.

This column link on A2 only fires the dynamic action D2 if dynamic action D2 has a higher sequence than D1 (if i move it above D1 in the list it will fire, but then D1 does not fire for the column link on A1

 

Am I missing something?

 

Thanks

Kathryn

  • 1. Re: custom dynamic action not firing
    kgamble Newbie
    Currently Being Moderated

    Here is my page source from the browser (i put in some blank lines here to separate the 3 dynamic actions)

    <script type="text/javascript">

    apex.da.initDaEventList = function(){
    apex.da.gEventList = [
    {"triggeringElement":"P17_IS_OK","triggeringElementType":"ITEM","triggeringConditionType":"NOT_NULL","bindType":"bind","bindEventType":"change",actionList:[{"eventResult":true,"executeOnPageInit":true,"stopExecutionOnError":true,"affectedElementsType":"BUTTON",javascriptFunction:apex.da.enable,"action":"NATIVE_ENABLE"},{"eventResult":false,"executeOnPageInit":true,"stopExecutionOnError":true,"affectedElementsType":"BUTTON",javascriptFunction:apex.da.disable,"action":"NATIVE_DISABLE"}]},


    {"triggeringElement":"document","triggeringElementType":"DOM_OBJECT","bindType":"live","bindDelegateTo":document,"bindEventType":"RefreshTrend_2",actionList:[{"eventResult":true,"executeOnPageInit":true,"stopExecutionOnError":true,"waitForResult":true,"affectedElementsType":"ITEM","affectedElements":"P17_KEY_2",javascriptFunction:apex.da.setValue,"ajaxIdentifier":"3BB4667C9E25BFB8DCF63639507A062A88F713A193C0D30DDF1CEA8D6875A7F9","attribute01":"JAVASCRIPT_EXPRESSION","attribute05":"this.data.key_2","attribute09":"N","action":"NATIVE_SET_VALUE"},{"eventResult":true,"executeOnPageInit":true,"stopExecutionOnError":true,"affectedElementsType":"REGION","affectedRegionId":"R2959102626294614",javascriptFunction:apex.da.refresh,"action":"NATIVE_REFRESH"}]},


    {"triggeringElement":"document","triggeringElementType":"DOM_OBJECT","bindType":"live","bindDelegateTo":document,"bindEventType":"RefreshTrend_1",actionList:[{"eventResult":true,"executeOnPageInit":true,"stopExecutionOnError":true,"waitForResult":true,"affectedElementsType":"ITEM","affectedElements":"P17_KEY_1",javascriptFunction:apex.da.setValue,"ajaxIdentifier":"51D6B9673F7096076392A95D9D00B417D49DEB96D878B419FC6D1E482D0AB2F0","attribute01":"JAVASCRIPT_EXPRESSION","attribute05":"this.data.key_1","attribute09":"N","action":"NATIVE_SET_VALUE"},{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,"affectedElementsType":"REGION","affectedRegionId":"R2925517394066336",javascriptFunction:apex.da.refresh,"action":"NATIVE_REFRESH"}]}];
    }
    </script>


    Only the first "document" dynamic action will fire, even though I fire them by name using
    javascript:$.event.trigger('RefreshTrend_1', [{key_1:'#COL01#' }]); from the column link.

     

    Kathryn

  • 3. Re: custom dynamic action not firing
    kgamble Newbie
    Currently Being Moderated

    Turns out the dynamic action set to fire on page load references an undefined javascript variable (page item is not yet populated at time of page load), so everything after that is ignored and the second dynamic action does not fire.

     

    I turned off fire on page load for dynamic actions and everything works

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points