4
votes

I have a classic report, where I just added one extra column, showing button:

Type: Plain Text
HTML Expression: 
<button class="deleteAccButton t-Button t-Button--stretch" data-id="#ID#" type="button">
    <span class="t-Button-label">Remove</span>
</button>

Then I've added dynamic action:

Event: Click
Selection Type: jQuery Selector
jQuery Selector: .deleteAccButton
Type: JavaScript expression
JavaScript Expression: RemoveTableData($(this.triggeringElement).data('id'));

In the page's Function and Global Variable Declaration I have JS function:

function RemoveTableData(my_id)
{
    // Simplified to describe the problem
    console.log('Removing ' + my_id);
    $('#tableregion').trigger('apexrefresh');    
}

The region containing classic report have Static ID of tableregion. So now each row has an extra button "Remove" and I expect my RemoveTableData function to be executed every time I press the button.

But it works only once right after the page loading. If I press any button second time, nothing will happen and no error is generated neither in Apex Debug nor in browser console. In order to be able to press the button again, I need to reload the page, which is not what I want. My intent was to have this functionality without submitting the page.

1

1 Answers

2
votes

Change the event scope to dynamic and add the tableregion static id in.