use of com.haulmont.cuba.core.entity.annotation.CurrencyValue in project cuba by cuba-platform.
the class WebCurrencyField method setDatasource.
@Override
public void setDatasource(Datasource datasource, String property) {
textField.setDatasource(datasource, property);
if (datasource != null && !DynamicAttributesUtils.isDynamicAttribute(property)) {
MetaProperty metaProperty = datasource.getMetaClass().getPropertyNN(property);
Object obj = metaProperty.getAnnotations().get(CurrencyValue.class.getName());
if (obj == null)
return;
// noinspection unchecked
Map<String, Object> currencyValue = (Map<String, Object>) obj;
String currencyName = (String) currencyValue.get("currency");
component.setCurrency(currencyName);
}
}
Aggregations