3

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

Scott Mikutsky
  • 746
  • 7
  • 21
user3780030
  • 81
  • 2
  • 8

3 Answers3

4

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");

Vance
  • 897
  • 5
  • 9
  • Hi Vance, Thank you so much. Since last 3 days I have been trying. I tried with dynamic action method as well as using below java script. $('input[name="f04"]').attr("readonly", true)); but nothing seemed to work. Your method worked like a charm. :) Thank you again. Appreciate it. – user3780030 Nov 24 '15 at 11:50
1

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";
 }
Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
  • Hi Muhammad, Thank you for your response. I had already applied same method but its not working. May be because my column is using a LOV from select list method. but I got it working using below line $("[name=f04]").css("pointer-events","none"); – user3780030 Nov 24 '15 at 10:42
  • Hi Muhammad, I changed property from "readonly" to "disabled" and it worked var curr_id = document.wwv_flow.f04[i].id; $x(curr_id).disabled = true; – user3780030 Nov 27 '15 at 10:20
0

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");


};
thor
  • 21,418
  • 31
  • 87
  • 173
Venky
  • 1