Skip to content

ALTER PAGE / ALTER SNIPPET cannot SET RenderMode on a dynamic text ("not a property of this built-in widget") #1228

Description

@MendixMau

Environment: mxcli upstream main at 95091765 (built from source), Mendix 11.12.2 (mx check from mxbuild 11.12.2). Fresh blank app from mx create-project, macOS.

Summary: alter page / alter snippet cannot set RenderMode on a dynamic text. create page and replace … with { … } both accept RenderMode on a dynamictext, and describe prints it, but set RenderMode = … on <dynamictext> is refused. The message says it is "not a property of this built-in widget". RenderMode is a real property of Forms$DynamicText, not a design property, so the hint to use design properties does not help either.

Steps to reproduce

create entity MyFirstModule.RmRow ( Name: String );

create or replace page MyFirstModule.P_SetRenderMode
(
  Title: 'Set RenderMode',
  Layout: Atlas_Core.Atlas_Default,
  Params: { $Row: MyFirstModule.RmRow }
)
{
  dataview dv (datasource: $Row) {
    dynamictext title (content: 'Title {1}', contentparams: [{1} = Name], rendermode: H1)
    dynamictext body (content: 'Body')
  }
}

alter page MyFirstModule.P_SetRenderMode {
  set RenderMode = H2 on title;
}

Actual (exit 1; the page keeps RenderMode: H1)

Created entity: MyFirstModule.RmRow
Created page MyFirstModule.P_SetRenderMode
Error: failed to set: failed to set RenderMode on title: property "RenderMode" is not a property of this built-in widget, and not an Atlas design property your theme declares for it — `set` writes its own properties (Caption, Class, Style, DynamicClasses, Visible, Editable, …) and any design property of this widget's type. Run `mxcli show design properties for <widget type>` to see which those are

The same happens with alter snippet … { set RenderMode = H4 on <dynamictext> }.

Expected: Altered page, and describe page shows RenderMode: H2, as it does when the page is created with rendermode: H2 directly.

Cause: setRawWidgetPropertyMut (mdl/backend/pagemutator/mutator.go) has no case for RenderMode, so the statement falls through to the pluggable-widget property setter. The MCP backend's mutator already handles it.

Workaround: replace <widget> with { dynamictext … (RenderMode: H2) }, which rewrites the whole widget.

I have a fix with tests and will open a PR that references this issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions