338 views

Description

Under some circumstances, fields set to readonly do not set consistent attributes on form inputs.

Steps to Reproduce

  1. Create a new ACL with the following values:

    Type: record
    Operation: write
    Admin overrides: false
    Advanced: true
    Name: incident.category
    Script: false;

  2. Open an incident form.

    The Category field will be readonly.

  3. Write a client script to log g_form.isDisabled('category') or open the browser console and execute g_form.isDisabled('category'). (Ensure that gsft_main frame is selected.)

    The g_form functions isReadOnly and isDisabled both return false, they should return true.

  4. Execute g_form.getControl('category').

    The DOM element does not have these attributes:
    class="disabled readonly" readonly="readonly" disabled=""

  5. Execute g_form.setReadOnly('category', true)

    isDisabled and isReadOnly functions will now return true

    The element returned by g_form.getControl('category') will have these attributes: class="disabled readonly" readonly="readonly" disabled=""

 

 

Workaround

Use a client script to manually set g_form.setReadOnly(field, true) so that the form API properly recognizes the field as readonly.


Related Problem: PRB638071

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-01-06 13:10:23
Published:2016-10-28