Oracle Apex: Set Page Items Value Using JavaScript on the Click of a Link in Interactive Report

This Oracle Apex tutorial shows you how to set page items value using JavaScript on the click of a link in Interactive Report.

Follow these steps to perform this task:

1. Create a JavaScript Function.

Create a JavaScript function for the page having the interactive report. To add the function, click on the page then in the property palette, JavaScript > Function and Global Variable Declaration, add the following code:

function setItems(pempid, pdeptid)
{ 
    apex.item( "P7_EMPID" ).setValue (pempid);
    apex.item( "P7_DEPTID" ).setValue (pdeptid);
}

The above JavaScript function code will set the page items P7_EMPID and P7_DEPTID values using the apex.item().setValue() JavaScript APIs, to the values passed by the parameters. We will call the above JavaScript function on the click of a link in the interactive report.

2. Call the JavaScript Function on the Link Click of Interactive Report.

Now select the column in the interactive report from which you want to call the JavaScript function to set the values. Set the type of the column to Link and set the target type as URL and add the following code for the URL value:

javascript:setItems(#EMPLOYEE_ID#, #DEPARTMENT_ID#);

It is done. Save the changes and test the report.

See also:

Vinish Kapoor
Vinish Kapoor

Vinish Kapoor is a seasoned software development professional and a fervent enthusiast of artificial intelligence (AI). His impressive career spans over 20 years, marked by a relentless pursuit of innovation and excellence in the field of information technology. As an Oracle ACE, Vinish has distinguished himself as a leading expert in Oracle technologies, a title awarded to individuals who have demonstrated their deep commitment, leadership, and expertise in the Oracle community.

One comment

Comments are closed.