We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Search report row selected listener

Question
20
Views
0
Comments
edited Feb 2, 2020 10:09AM in General Technical Discussions

Summary

addSearchReportValueSetListener issue

Content

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>

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!