Skip to content

[Bug] ALTER PAGE REPLACE cannot find FOOTER widget inside a DataView #293

@Chendodelangen

Description

@Chendodelangen

Summary

REPLACE widgetName WITH { ... } fails with "widget not found" when the target widget is a FOOTER nested inside a DATAVIEW, even though DESCRIBE PAGE correctly reports the widget by that name.

Environment

  • mxcli version: current
  • Mendix version: 10.24.15

Steps to Reproduce

  1. Page has this structure (confirmed by DESCRIBE PAGE):

    DATAVIEW dataView1 (DataSource: $Asset) {
      TEXTBOX textBox1 (Label: 'Reason', Attribute: ReasonForChange)
      FOOTER footer1 {
        ACTIONBUTTON actionButton1 (Caption: 'Save', Action: CALL_MICROFLOW Mod.ACT_Save)
        ACTIONBUTTON actionButton2 (Caption: 'Cancel', Action: CANCEL_CHANGES CLOSE_PAGE)
      }
    }
    
  2. Attempt to replace the footer:

    ALTER PAGE Mod.MyPage {
      REPLACE footer1 WITH {
        FOOTER footer1 {
          ACTIONBUTTON btnSave (Caption: 'Save', Action: MICROFLOW Mod.ACT_Save, ButtonStyle: Primary)
          ACTIONBUTTON btnCancel (Caption: 'Cancel', Action: CLOSE_PAGE)
        }
      }
    };
    
  3. Result:

    Error: failed to REPLACE: widget "footer1" not found
    

Expected Behaviour

The FOOTER and its children are replaced.

Actual Behaviour

mxcli cannot find footer1 even though DESCRIBE PAGE shows it at that name. The widget appears to be outside the REPLACE traversal scope when nested inside a DataView.

Workaround

Replace individual child buttons instead of the parent FOOTER:

ALTER PAGE Mod.MyPage {
  REPLACE actionButton1 WITH {
    ACTIONBUTTON btnSave (Caption: 'Save', Action: MICROFLOW Mod.ACT_Save, ButtonStyle: Primary)
  };
  REPLACE actionButton2 WITH {
    ACTIONBUTTON btnCancel (Caption: 'Cancel', Action: CLOSE_PAGE)
  }
};

Note: the replacement buttons must use different names from the originals, otherwise a duplicate-name error is raised during the replace operation.

Severity

Low / Medium — workaround exists, but the REPLACE-FOOTER pattern is documented and intuitive; the silent scope limitation is confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions