Search in sources :

Example 1 with LookupSource

use of de.metas.ui.web.window.descriptor.DocumentLayoutElementFieldDescriptor.LookupSource in project metasfresh-webui-api by metasfresh.

the class DescriptorsFactoryHelper method extractWidgetType.

public static DocumentFieldWidgetType extractWidgetType(final String columnName, final int displayType, final LookupDescriptor lookupDescriptor) {
    final DocumentFieldWidgetType widgetType = extractWidgetType(columnName, displayType);
    if (lookupDescriptor != null && (widgetType == DocumentFieldWidgetType.List || widgetType == DocumentFieldWidgetType.Lookup)) {
        final LookupSource lookupSourceType = lookupDescriptor.getLookupSourceType();
        final DocumentFieldWidgetType lookupWidgetType = extractWidgetType(lookupSourceType);
        if (lookupWidgetType != widgetType) {
            // 
            logger.warn(// 
            "Inconsistent '{}/{}'({}) vs '{}'({}). Considering the widgetType provided by lookupSourceType.", // 
            columnName, // 
            displayType, // 
            widgetType, lookupSourceType, lookupWidgetType);
        }
        return lookupWidgetType;
    }
    return widgetType;
}
Also used : LookupSource(de.metas.ui.web.window.descriptor.DocumentLayoutElementFieldDescriptor.LookupSource) DocumentFieldWidgetType(de.metas.ui.web.window.descriptor.DocumentFieldWidgetType)

Aggregations

DocumentFieldWidgetType (de.metas.ui.web.window.descriptor.DocumentFieldWidgetType)1 LookupSource (de.metas.ui.web.window.descriptor.DocumentLayoutElementFieldDescriptor.LookupSource)1