oracle-apex

Oracle Apex Populate read only field based on another field


I have an 2 tables.

select emp_id,dept_name,emp_name,commision from employee_dets;

select emp_id,dept_name, bu,org from emp_profile;

I have an interactive grid based on EMP_PROFILE table.

Here:

EMP_ID  is a select list
select emp_name d,emp_id r from employee_Dets;

DEPT_NAME is also a select list: 

select dept_name d, dept_name r from employee_Dets where emp_id= :EMP_ID;

So DEPT_NAME is populating on basis of EMP_ID column. Currently its drop down.

But i want it to be read-only, still auto populate when EMP_ID is selected and save to database.

If i make it read-only-> Always, the value doesnt auto populate.


Solution

  • The server defined "read only" attribute makes the item/column "inactive". It will not be submitted to the server (this behaviour is same for page items as for IG columns). The solution is to make the column read only on the UI only, not in the underlying model. This can be achieved with css:

    Add on the specified column of your interactive grid region in CSS Classes property at Appearance attribute: is-readonly .

    enter image description here