PivotTable : datasource value on click

Hi
I have the following pivotTable and want to display the details of the cell clicked.I already have prepared a screen to display the details. Now need to send parameters when opening the popup screen.

14%20PM

for example, when I click on the cell value 46,480.00 then I want to display the screen data filtered by Production Line 1 and Date 25/09/2018. How can I get those parameter values?

Hi,

You can use PivotTable#addCellClickListener to obtain information about the clicked value and applied filters.

Regards,
Gleb

Hi Gleb
Thanks. Sorry that didn’t share what I have done and what exactly my question more specifically.
Here is my code for ClickListener in controller where catching value is not correct as i didn’t find how to catch it from the event.

    pivotTable.addCellClickListener(event -> {
               openWindow("erp$Productionplandetail", WindowManager.OpenType.DIALOG, ParamsMap.of(
                    "resource", productionPlanContinuousProdPivotsDs.getItem().getResource(), "prodDate", productionPlanContinuousProdPivotsDs.getItem().getProdDate()))
 });

My specific question is, how can I get the variables from the cell like ProdDate (from the respective header), Resource (from the row).

event.getValue() - clicked cell value
event.getFilters() - clicked cell applied filters. In your case, you can obtain the ProdDate value.

Thank you Gleb. Now it is returning the Row filters but throwing null value for column filter.
I have the following code:

        pivotTable.addCellClickListener(event -> {
            showNotification("Value: " + event.getValue() + ",\n"
                    + "Filters applied: " + event.getFilters().get("Resource")  + ",\n"
                    + "Filters applied: " + event.getFilters().get("ProdDate")
            );
        });

I get the following result:

06%20PM

As you can see the filter event.getFilters().get(“ProdDate”) did return null value. Thanks for any further help.

I suppose that the localized name of the prodDate attribute is Prod Date, not ProdDate. Any way, you can out a break point and investigate the content of the filters map.

Regards,
Gleb

Hi Gleb
It’s now working, the code that worked is “Prod date” as follows:

    showNotification("Value: " + event.getValue() + ",\n"
                + "Filters Resource: " + event.getFilters().get("Resource")  + ",\n"
                + "Filters Prod Date: " + event.getFilters().get("Prod date")  + ",\n"
                + "Filters Plant: " + event.getFilters().get("Plant")
        );