cuba-platform / documentation

CUBA Platform Documentation
https://www.cuba-platform.com
Creative Commons Attribution 4.0 International
26 stars 45 forks source link

Actualize and fix code example in gui_themes #775

Closed owlet1997 closed 3 years ago

owlet1997 commented 3 years ago

Enviroment:

Description of the bug or enhancement

page https://doc.cuba-platform.com/manual-7.2/web_theme_extension.html §3.5.9.2 Extending an Existing Theme, #Creating new styles

Case 1 Incorrect injecting of TextField nameField: AR:

@Named("fieldGroup.name")
private TextField nameField;

ER:

@Inject
private TextField<String> nameField;

Case 2 Incorrect handling an event InitEvent: AR:

@Override
public void init(Map<String, Object> params) {
    nameField.setStyleName("name-field");
}

ER:

 @Subscribe
    public void onInit(InitEvent event) {
        nameField.setStyleName("name-field");
    }


page https://doc.cuba-platform.com/manual-7.2/web_theme_inheritance.html 3.5.9.4. Using Themes from Application Components

Case 3 Incorrect adding property {theme-name}-theme.properties to cuba.themeConfig application property to inherit theme as is AR:

cuba.themeConfig = com/haulmont/cuba/hover-theme.properties /com/company/{app-component-name}/{theme-name}-theme.properties

ER:

cuba.themeConfig = com/haulmont/cuba/hover-theme.properties /com/company/{app-component-name}/web/{theme-name}-theme.properties