IR Refresh Instead of Page Refresh when Model Dialog Close / Restore screen position after refresh
A) IR Refresh Instead of Page Refresh when Model Dialog Close
https://apex.oracle.com/pls/apex/f?p=90922:18
1) Save function as refreshCurrent.js
function refreshCurrent(pRegionId){
var lReportId = "#"+pRegionId+"_ir";
/** @purpose retrieve the current min row of an IR by parsing the pagination label of an "X - Y" or X - Y of Z" scheme.
*@param IR id
*/
function getCurrentPagination (pReportId) {
var currentText = apex.jQuery(".a-IRR-pagination-label", pReportId).text()
, currentMinRow = currentText.substring(0, currentText.indexOf("-")).trim();
return currentMinRow;
};
/** @purpose paginates the IR with the indicated settings
* @param pRegionId IR id
* @param pMinRow row to start the pagination at
* @param pMaxRows irrelevant. This is not parsed anywhere.
* @param pRowsFetched irrelevant. This is not parsed anywhere. Rows to be fetchedd is determined serverside by minrow + rows displayed
*/
function paginateIR (pReportId, pMinRow,pMaxRows,pRowsFetched){
var fakeButton = apex.jQuery("<button>"
, { attr: { "class":"a-Button a-IRR-button a-IRR-button--pagination"
, "data-pagination":"pgR_min_row="+pMinRow+"max_rows="+pMaxRows+"rows_fetched="+pRowsFetched
}
, css: {"display":"none"}
}
).click(function(e){ e.preventDefault(); });
apex.jQuery(pReportId).append(fakeButton);
fakeButton.click();
fakeButton.remove();
};
// maxrows and rowsfetched are irrelevant.
paginateIR(lReportId, getCurrentPagination(lReportId), 1, 1);
};
2) Add the refreshCurrent.js file as Static Application File (Go to Share Components)
3) Got o User Interface of Application --> JavaScript Tab --> Add File URL i.e #APP_IMAGES#refreshCurrent.js
4) Define the Static ID of Interactive Report i.e ITEM_DTL
5) Create DA on Interactive Report -->
Event : Dialog Closed
Selection Type : Region
Region : Interactive Report Region
Action : Execute Java Script
Code: refreshCurrent('ITEM_DTL');
Comments
Post a Comment