Search report row selected listener
Summary
addSearchReportValueSetListener issueContent
Hi,
I have a search report on my WorkSpace and i am trying to add a listener for "row selection". i used the "addSearchReportValueSetListener" but i am not able to catch the event.
The documentation is attached.
Thanks.
Code Snippet
<script> var searchListenerRegistered = false; ORACLE_SERVICE_CLOUD.extension_loader.load('SampleApp') .then(function(IExtensionProvider) { IExtensionProvider.registerAnalyticsExtension(function(IAnalyticsContext) { IAnalyticsContext.addTableDataRequestListener('Ext2$Table', dataSupplier); }); }); function dataSupplier(report) { if (!searchListenerRegistered) { report.addSearchReportValueSetListener(searchListener); searchListenerRegistered = true; } var returnData = report.createReportData(); for (var i = 0; i < 10; i++;) { var row = report.createReportDataRow(); var firstColumn = report.createReportDataCell(); var secondColumn = report.createReportDataCell(); var thirdColumn = report.createReportDataCell(); firstColumn.setData(i); secondColumn.setData('Test' + i); thirdColumn.setData('Test' + i); row.getCells().push(firstColumn); row.getCells().push(secondColumn); row.getCells().push(thirdColumn); returnData.getRows().push(row); } returnData.setTotalRecordCount(10); return returnData; } function searchListener(selectionContext) { var searchReportContext = selectionContext.getSearchContext(); console.log('Searching record of type: ' + searchReportContext.getSearchType()); console.log('Searching report ID: ' + searchReportContext.getId()); var searchFieldDataKey = searchReportContext.getSearchFieldDataKey(); console.log('Searching value for: ' + searchFieldDataKey.getEntityType() + '.' + searchFieldDataKey.getFieldKey()); var selectedRow = selectionContext.getSelectedRow(); console.log('Selected row details: ' + selectedRow); return 60; } </script>
Tagged:
0