I’ve created a Config Interface according to
https://doc.cuba-platform.com/manual-6.10/config_interface_usage.html
within global module.
package com.company.prueba;
import com.haulmont.cuba.core.config.Config;
import com.haulmont.cuba.core.config.Property;
import com.haulmont.cuba.core.config.Source;
import com.haulmont.cuba.core.config.SourceType;@Source(type = SourceType.APP)
public interface TaguaConfig extends Config {@Property("company.name") String getCompanyName();
}
Added to app.properties file within app-core module the following:
company.name = hello world
Added a button to a browse controller and tried to have the property shown to the screen
package com.company.prueba.web.person;
import com.company.prueba.TaguaConfig;
import com.haulmont.cuba.core.global.AppBeans;
import com.haulmont.cuba.core.global.Configuration;
import com.haulmont.cuba.gui.components.AbstractLookup;public class PersonBrowse extends AbstractLookup {
public void show() { String companyName = AppBeans.get(Configuration.class).getConfig(TaguaConfig.class).getCompanyName(); showNotification(companyName); }
}
Started the app, accessed the person browse controller and clicked show button. Only blank value appears. According to debug tests companyName String is only with null value.
Am I missing something?
Please see project attached.
prueba.zip (80.9 KB)