Skip to content

NOCANCEL of SHOW / DIALOG also hides the form's Share action and ends with the first Save #1956

Open

Description

@CrushBy

Description

The NOCANCEL option of the SHOW and DIALOG operators hides the Cancel system action of the opened form. It also removes the Share system action (System.formShare[], the button with the share icon at the bottom left of the form in the web client) — on every form, including one that is not the session owner, where no Cancel action is shown anyway: NOMANAGESESSION NOCANCEL changes nothing but the disappearance of Share. The Customize action next to it stays.

Reproducer (a module in the navigator of any application):

MODULE NoCancelShare;

REQUIRE System;

NAMESPACE NoCancelShare;

CLASS Item 'Item';
name 'Name' = DATA STRING[50] (Item);

FORM items 'Items'
    OBJECTS i = Item
    PROPERTIES(i) name, NEW, DELETE
;

showDefault 'Show' () { SHOW items MANAGESESSION; }
showNoCancel 'Show NOCANCEL' () { SHOW items MANAGESESSION NOCANCEL; }
showNoOwnerNoCancel 'Show NOMANAGESESSION NOCANCEL' () { SHOW items NOMANAGESESSION NOCANCEL; }

NAVIGATOR {
    NEW FOLDER noCancelShare 'NOCANCEL probe' WINDOW toolbar {
        NEW showDefault;
        NEW showNoCancel;
        NEW showNoOwnerNoCancel;
    }
}

Open the form through each of the three navigator elements and compare the system buttons at the bottom of the form:

Opened by Expected Actual
showDefault Share, Customize, Refresh, Save, Cancel, OK, Close as expected
showNoCancel the same without Cancel Share is missing as well
showNoOwnerNoCancel Share, Customize, Refresh, OK, Close (a form that is not the session owner shows no Save and no Cancel) Share is missing

CANCEL instead of NOCANCEL keeps Share; DIALOG items MANAGESESSION NOCANCEL DO {} behaves like showNoCancel.

The option also does not outlive the first Save: on a card opened with SHOW item OBJECTS i = ... MANAGESESSION NOCANCEL (an editable form of one object), change a value and press Save — after the save the form shows Cancel and Share, as if no NOCANCEL had been given.

Checked on master 54dc3af (2026-11-03) in the web client; the v6 branch carries the same code.

Fix

Pass the option to the form as a flag of its own, kept for the lifetime of the form, and hide only the Cancel action by it, so that Share keeps reacting to the "form opened for a newly created object" flag alone — CANCEL / NOCANCEL then still override the default for Cancel exactly as now, and a save on the form no longer cancels the option. Add a check that NOCANCEL leaves every other system action in place and still holds after a save.

Reason

The option does not reach the form as a separate flag: the form has one logical flag that marks a form opened for a newly created object (where cancelling the changes would discard the object itself, so the platform hides Cancel there on its own), and NOCANCEL / CANCEL only force that flag on or off. Cancel is hidden when the flag is set — and so is Share, whose display condition is bound to the same flag (a link to an unsaved object makes no sense). Customize is not affected because its visibility is governed by a condition of its own. The flag is cleared once the form's changes are saved (the object is not new any more), which also ends the effect of an explicit NOCANCEL.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions