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!

How do you make a Checkbox or Popup LOV readonly?

Glenda HasleyApr 25 2022

We are on APEX 21.2

On the following Form page, the Completed field is a PopUp lov.
When the user changes the Completed Field from No to Yes, a dynamic action is triggered.

image.png
This dynamic action triggers a confirm, several Set Values to set the values in the above yellow highlighted fields and Execute JavaScript Codes to make those fields readonly.

How do I make the Completed field readonly?

I tried the following:
$(document.wwv_flow.P6_ASSIGNEE_COMPLETE_FLAG).attr('disabled',true); (this set the Completed field to null)

document.getElementById("P16_ASSIGNEE_COMPLETE_FLAG").readOnly = true; (the user is still able to update the field)

Comments

Hamza Al-abbasi

Create another Item with type hidden to hold P16_ASSIGNEE_COMPLETE_FLAG value before it's being disable and in Processing section create a process to assign the value from the hidden item to P16_ASSIGNEE_COMPLETE_FLAG :

:P16_ASSIGNEE_COMPLETE_FLAG := :P16_HIDDEN
InoL

Anything you do in a form won't be saved in the database until you submit it.
So, after all your Set Value DA steps, you should submit the page.
Now it is a simple Read Only condition on P6_ASSIGNEE_COMPLETE_FLAG to render this item as a read only item when i's value is Yes.

Completed field is a PopUp lov.
Looks like a Select List to me. It's easy for a DA to make it disabled. "Disable" is a standard DA action.

Glenda Hasley

Hamza Al-abbasi I am very new to apex. Would you mind explaining to me how to create a process to assign the value from the hidden item to P16_ASSIGNEE_COMPLETE_FLAG ?

Glenda Hasley

InoL
When the user selects the completed flag (I have tried a checkbox and Popup Lov) a dynamic action is triggered. The first True Value is a Confirm action. If the user clicks OK on the confirmation, it will populate all of those highlighted fields in the screen print. We do not want the user to be able to change the completed flag after they selected the OK on the Confirmation. We do not want the changes to be made on the database until they click 'Apply Changes'.
I cannot use the Read Only configuration on the Page Item because an approver can reject the task. When an approver rejects the task, the completed flag is set back to No. I have to use 'Execute JacaScript Code' to make the field readonly (otherwise I get a session state error).
When I use a checkbox or Popup LOV the field is still modifiable even though I have set it to readonly using Execute JavaScript code where the code is like the following:
document.getElementById("P16_ASSIGNEE_COMPLETE_FLAG").readOnly = true;

1 - 4

Post Details

Added on Apr 25 2022
4 comments
2,150 views