3
votes

I am new to Oracle APEX. Can you please help me with below issue? I am using APEX 5.0

I have a master detail page where I have a Tabular form. One of the column is using LOV from select list.

Now I have to make this column values as read only so that users can not change it, except on a new row when “Add Row” is clicked.

Many Thanks in advance :)

Gaurav

3

3 Answers

4
votes

I am assuming that you know how to use the "Inspect element" feature of your browser. (If not then here's how): Run your page. Then right click on one of the select lists in the column that you want to set as read only. A window will appear at the bottom of your page. Get it's name attribute. It should be something that starts with "f0.."(eg. "f01"). Then on your "Execute on Page Load" part of your page, enter this line of code: $("[name=the_name_you_just_copied]").css("pointer-events","none");

sample line: $("[name=f01]").css("pointer-events","none");

1
votes

This can be done using javascript. Read the following demo with detail description to perform such task Tabular Form's Column Read-Only and No Duplication and this discussion

For Example:

if ($x(field_id).value != "") {
    $x(field_d).readOnly = "readonly";
 }
0
votes

Thanks Vance for the solution. I had a similar issue but I wanted it read-only on an action. So the $("[name=f01]").css("pointer-events","none"); can also be used in any javascript function as well.

function alerts_c(){

     var insno= $v('P14_SYSINSNO');
     var workDate = $v('P14_WORK_DATE');


    $('.t-Report-report tr').last().find('[name=f02]').val(insno)
    $('.t-Report-report tr').last().find('[name=f03]').val(workDate)
    $("[name=f02]").css("pointer-events","none");
    $("[name=f03]").css("pointer-events","none");

    apex.event.trigger(document,"alerts_d");


};