What is difference between setReadOnly() and setDisabled() function?

_onali
Kilo Contributor

Difference between setReadOnly() and setDisabled() function

5 REPLIES 5

rami7
Kilo Contributor

Hi sonali,




setReadonly(fieldName, boolean)


Makes the field read-only if true. Makes the field editable if false.
Note: Both setReadOnly and setReadonly are functional.
Best Practice: Use UI Policy rather than this method whenever possible.


setDisabled(fieldName, boolean)


Grays out field and makes it unavailable.

Ashutosh Munot1
Kilo Patron
Kilo Patron

SetReadonly is:


Makes the field read-only if true. Makes the field editable if false.
Note: Both setReadOnly and setReadonly are functional.
Best Practice: Use UI Policy rather than this method whenever possible.


SetDisabled is used to make field gray out and unavailable.


akashsrm100
Kilo Guru

Hi


setDisabled() function Grays out field and makes it unavailable.


where setReadOnly() Makes the field read-only if true, editable if false



Thanks


Akash Sharma