Step1) Create 3 Pages
- Page 21 is the Report page
- Page 28 is a Standard page with P28_ITEM item.
- Page 29 is a Modal Page with P29_ITEM item.
Step 2)Page21 Report Page
Create a Report Item P21_ATOM
Create report as following:
Select 'A' Des, 1 lnk from dual
union all
Select 'B' Des, 2 lnk from dual
union all
Select 'C' Des, 3 lnk from dual
Set the Lnk Column Attribute to Plain Text and in the HTML expression add the following:
Create an AJAX Callback PREPARE_URL with the following:
DECLARE
l_url varchar2(5000);
BEGIN
l_url := trim(both '''' from
regexp_substr(apex_util.prepare_url(p_url => apex_plugin_util.replace_substitutions(APEX_APPLICATION.G_X01)), '''f\?p=[^'']*'''));
htp.prn(l_url);
END;
Add the Following to the page ==>Function and Global Variable Declaration:
function meFunc(){
alert($v('P21_ATOM'));
}
function openStandardPage() {
var l_url = 'f?p=83009:28:109022518455751::NO::P28_ITEM:' + $v('P21_ATOM');
apex.navigation.redirect(l_url);
}
function openDialog() {
var l_url = 'f?p=83009:29:109022518455751::NO::P29_ITEM:' + $v('P21_ATOM');
apex.server.process('PREPARE_URL', { "x01": l_url }, {
"dataType": "text",
async: false,
"success": function(pData) {
if (pData === 'INVALID') {
console.log('The data you have entered is invalid');
};
l_url = pData;
}
});
var link = l_url.replace(/\\u(\d\d\d\d)/g, function(m,d) {
return String.fromCharCode(parseInt(d, 16));
});
apex.navigation.dialog(link,
{title: 'Modal Page',
resizable: true, draggable: true, height:500,width:720,maxWidth:960,modal:true,dialog:null},
't-Dialog--standard',
this);
}
Create a dynamic action to set the value of P21_ATOM e.g
- Click event
- jQuery Selector: .lnk
- Action:
- Affected Element(item): P21_ATOM
- Set Value via javascript
this.triggeringElement.dataset.val;
Attach the toolbar to the report column by dynamic Action
- Page Load Event
- Action: Contextual Toolbar(dynamic Action Plugin)
- Affected Element jQuery Selector: .lnk
- Toolbar Source: List
- List Name: lst_report
Step 3) Create the List for the Toolbar
Goto Application==> Shared Components ==> List ==> Create New
- List Type:Static
- List Name: lst_report
List Entries
- Entry 1
- Image/Class :fa-adjust
- List Entry Label:Page Standard
- Target(URL javascript funtion):openStandardPage();
- Entry 2
- Image/Class :fa-anchor
- List Entry Label:Modal Page
- Target(URL javascript funtion):openDialog();
- Entry 3
- Image/Class :fa-google
- List Entry Label:Google Search
- Target(URL):https://www.google.com.pk/search?&q=GITHUBPLANETAPEX83009
- Entry 4
- Image/Class :fa-adn
- List Entry Label:javascript call
- Target(URL javascript funtion):meFunc();
- Entry 5
- Image/Class :fa-android
- List Entry Label:My Profile
- Target(URL):https://www.linkedin.com/in/m-yasir-ali-shah-13b5016a/