oracleoracle-apexoracle-apex-19.2

Oracle apex 19.2 show user if collapsible report is empty


I need to show the user if any collapsible report has rows in it or empty (when it is in collapsed state)

I'm trying to find a global and simple solution that can work on all tables.

currently, my only idea is to make dynamic action ("notify empty") for each report after refresh. then check in 'Client-side Condition' with javascript if it has rows with:

$(this.triggeringElement).find('.nodatafound').length==1;

then I'm coloring the collapsible icon to red/green accordingly with:

$(this.triggeringElement).find('.t-Button--icon').css("background-color", "red")

enter image description here

This solution works (for classic and interactive reports, but I don't have interactive grid anyway) But I have many tables, and even if I put my javascript code in functions, it repeats itself a lot. I'm looking for a more maintainable option. Something like built in dynamic action for all reports that I can put in a single place.

Thanks


Solution

  • I also use the after-refresh client side condition to test for any results.

    I've been thinking about a global method for this for some time, so I thought I'd finally give something a go.

    You could have an after-refresh dynamic action on the global page that tests any classic report using the jQuery selector .t-Region

    Then have the same client condition and actions on the triggering element.

    The selector on the global page can be extended to include IR as well. If you want to nominate which regions to test, then you could add a class the region's Appearance - CSS Classes attribute.

    Alternatively, you could use the :not() CSS selector on the dynamic action as a way to exclude nominated regions using the same attribute.