redacted redacted redacted
It is not possible to add addonAfter per default via FormModelMap in Control.component props.
The reason here is that the underlying default component (in @com.mgmtp.a12.formengine/formengine-core/src/view/internal/components/form-engine/cells/controls/input-control.tsx) used for decision if input or text output should be shown will create customized modelElement property for which only certain properties will be taken from handed over modelElement in FormModelComponentProps, addonAfter is not included there.
Possible workarround would be to decide on FormModelMap level if TextOuput Widget (from widget lib) should be shown, when you are in context of a FieldBasedInputType (Control or FieldOverviewColumn).
// a simple condition to check if the form model element is explicitly set to readonly mode text
fieldBasedInput.readonly && fieldBasedInput.readonlyPresentation === "TEXT"
// !if readonly states are inherited you need to implement a more sophisticated approval
// like done in @com.mgmtp.a12.formengine/formengine-core/src/view/internal/utilities/enablements/readonly-presentation.ts
Then you need to pass and calculate all props that are necessary for your usecase (e.g. label and value needs to be calculated from given props).
export const TextOutputAddonAfterControlComponent = (function TextOutputAddonAfterControlComponent(props){
const {modelElement: fieldBasedInput} = props;
if(fieldBasedInput.readonly && fieldBasedInput.readonlyPresentation === "TEXT") {
// here calculation is necessary to retrieve correct localization and a
return <TextOutput label={"LABEL"} addonAfter={<Button label={"addonAfter Button"}/>}>{fieldBasedInput.elementPath.map(m => m.elementName).join("/")}</TextOutput>
}
return <DefaultFormModelMap.Control.component {...props} />
} as typeof DefaultFormModelMap.Control.component)
Example output:

Another solution: file a feature request to a12 form engine to expose the TextOutput component they use into the DefaultWidgetMap instead of having it internal inside the DefaultComponentMap.
Thanks, that was really helpful!
hi @alicia-secure-haze this is a perfect use case for the widget map. please create a requirement.
redacted redacted redacted
Hello @alicia-secure-haze,
the corresponding Requirement Ticket is now done and delivered with the 2025.06 release.
All the Best
your Discourse Team