Skip to content

Document ability to replace UI component by using ComponentRegistration with replaceComponent() #1106

@alexbudarov

Description

@alexbudarov

We can replace standard UI components with apparently public Jmix API:
Example:

    @Bean
    public ComponentRegistration datePicker() {
        return ComponentRegistrationBuilder.create(ExtendedDatePicker.class)
                .withComponentLoader("datePicker", DatePickerLoader.class)
                .replaceComponent(TypedDatePicker.class)
                .build();
    }

public class ExtendedDatePicker<V extends Comparable> extends TypedDatePicker<V> {

    public static final String FAST_INPUT_DATE_FORMAT = "ddMMyyyy";

    @Override
    protected void initComponent() {
        super.initComponent();
        getI18n().setDateFormats(
                messages.getMessage("dateFormat"),
                FAST_INPUT_DATE_FORMAT
        );
    }
}

But Jmix docs don't contain such information.
AI assistant also doesn't have any idea about such ability:
https://ai-assistant.jmix.io/chatbot?chatSessionId=019c4bf9-8bee-750a-9bde-ece8035f2f9e

Metadata

Metadata

Assignees

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