A method to create a "change all" checkbox in the column heading of (interactive) reports.
Using that function has a few drawbacks:
- It will always select the first checkbox column of the report, even when that is not the one you want. E.g. in this report it would select the "Was Selected" column instead of the "Select" column, because the sequence of the checkbox columns has been changed.
- $f_CheckFirstColumn does not take into account whether a checkbox is disabled; if it is disabled, you probably don't want to change its status.
- Consequently, the "select all" option is shown even when none of the checkboxes can be changed; not very elegant.
All these drawbacks are addressed by the method shown here.
- For dynamic action "P1002_SELECTED_N update (on change)", "Fire On Page Load" has to be set to true. This doesn't seem logical but is needed to get this to work on 1st page load.
- Toggle the "Deptno = 10" filter to see that the "select all" checkbox is only added if there is at least 1 enabled checkbox; adding it when none of the checkboxes can be changed would not make a lot of sense.
- "P1002_SELECTED_N update (on change)": Updates the "Selected" number field, whenever the IR is changed. Not needed for Classic Reports, see below.
- "P1002_SELECTED_N update (after refresh)": Updates the "Selected" number field, whenever the IR is refreshed. We need both this and the "on change" dynamic action (for Interactive Reports anyway), to get both the checkbox selection and the report filter to work.