rules repository

A-1070 Always reload pages with editable Interactive Grids only for success.

Severity Error SQL-based Test Free New

Reason

An editable Interactive Grid saves its changes with an Ajax request and relies on the page staying in place after a submit. APEX requires Reload on Submit = Only for Success on such pages; with Always the page fails with "Page cannot render.

Set the page attribute Reload on Submit to Only for Success (the default for new pages).

Example

Non-Compliant Example

page 10 (
    // ...
    advanced {
        reloadOnSubmit: always
    }

    region orders (
        name: Orders
        type: interactiveGrid
        // ...
        edit {
            enabled: true
        }
    )
)
Issues
LineColumnMessage
425Page has an editable Interactive Grid but reloads on submit always.

Compliant Solution - ★★★★★

page 10 (
    // ...
    region orders (
        name: Orders
        type: interactiveGrid
        // ...
        edit {
            enabled: true
        }
    )
)

Tests

Test SQL query

select aa.workspace || '.' || aa.alias || '.' || p.page_id as identifier,
       'Page ' || p.page_id || ' of app ' || aa.alias || ' in ' || aa.workspace
         || ' has an editable Interactive Grid but reloads on submit always.' as message
  from apex_application_pages p
  join apex_applications aa
    on aa.application_id = p.application_id
       and aa.workspace = p.workspace
 where aa.workspace in (#ApexWorkspaces#)
   and p.reload_on_submit_code = 'A'
   and exists (select 1
                 from apex_appl_page_igs ig
                where ig.application_id = p.application_id
                  and ig.page_id = p.page_id
                  and ig.is_editable = 'Yes')

Test results

IdentifierMessageMigration
WORKSPACE.CUSTOMERS.10Page 10 of app CUSTOMERS in WORKSPACE has an editable Interactive Grid but reloads on submit always.-

Parameters

Use parameters to customize the rule to your needs.

ParameterDescriptionDefault Value
ApexWorkspacesComma-separated List of APEX workspaces owning APEX applications to check.dblinter, dbl_gui

References