Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with Setting Columns to Readonly on Button Click

Joe RJul 18 2016 — edited Jul 20 2016

Version 4.2.5.00.08

Hello,

I was asked by a coworker for help with making 3 column read only in a Tab Form.

The 3 columns are created with the API's

1 APEX_ITEM.date_popup with the id assigned as 39.

2 APEX_ITEM.select_list_from_query_xl with the id's assigned as 31 and 32.

There is a button that when clicked with make these 3 columns readonly on the tab form. The are other columns that will become visible when this toggle happens.

I had some old code to make these columns readonly on page load. The issue is that Date column calendar icon isn't disabled even though the calendar text field is.

The function is:

function make_existing_column_readonly()

{

    if (document.wwv_flow.f39) // Check to see at least one present

    {

       var l = document.wwv_flow.f39.length;

       if ($v('P280_CATPROM_COM') == "P")

       {

            if (l == undefined) // Have only one record

            {

                var curr_id = document.wwv_flow.f39.id;

                $x(curr_id).readOnly = "readonly";

                $x(curr_id).style.background = "silver";

                $x(curr_id).disabled = true;

            }

            else // Having multiple records

            {

                for (var i = 0; i < l; i++)

                {

                    var curr_id2 = document.wwv_flow.f31[i].id; //Select List

                    $x(curr_id2).readOnly = "readonly";

                    $x(curr_id2).style.background = "silver";

                    $x(curr_id2).disabled = true;

                    var curr_id3 = document.wwv_flow.f32[i].id; //Select List

                    $x(curr_id3).readOnly = "readonly";

                    $x(curr_id3).style.background = "silver";

                    $x(curr_id3).disabled = true;

                    var curr_id = document.wwv_flow.f39[i].id; //Datepicker

                    $x(curr_id).readOnly = "readonly";

                    $x(curr_id).style.background = "silver";

                    $x(curr_id).disabled = true;

                }

            }

       }

    }

}

Again, f39 is calendar that we're trying to make the icon disabled.

A different approach, if there is one, is more than appreciated.

What additional information can I provide?

Thanks,

Joe

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2016
Added on Jul 18 2016
11 comments
1,887 views