Search in sources :

Example 51 with DocumentPath

use of de.metas.ui.web.window.datatypes.DocumentPath in project metasfresh-webui-api by metasfresh.

the class DefaultView method getFieldTypeahead.

@Override
public LookupValuesList getFieldTypeahead(final RowEditingContext ctx, final String fieldName, final String query) {
    final DocumentId rowId = ctx.getRowId();
    final DocumentCollection documentsCollection = ctx.getDocumentsCollection();
    final DocumentPath documentPath = getById(rowId).getDocumentPath();
    return documentsCollection.forDocumentReadonly(documentPath, document -> document.getFieldLookupValuesForQuery(fieldName, query));
}
Also used : DocumentId(de.metas.ui.web.window.datatypes.DocumentId) DocumentPath(de.metas.ui.web.window.datatypes.DocumentPath) DocumentCollection(de.metas.ui.web.window.model.DocumentCollection)

Aggregations

DocumentPath (de.metas.ui.web.window.datatypes.DocumentPath)51 WindowId (de.metas.ui.web.window.datatypes.WindowId)22 DocumentId (de.metas.ui.web.window.datatypes.DocumentId)17 JSONDocumentPath (de.metas.ui.web.window.datatypes.json.JSONDocumentPath)17 List (java.util.List)10 Set (java.util.Set)9 TableRecordReference (org.adempiere.util.lang.impl.TableRecordReference)9 ImmutableList (com.google.common.collect.ImmutableList)8 ImmutableSet (com.google.common.collect.ImmutableSet)8 DetailId (de.metas.ui.web.window.descriptor.DetailId)7 AdempiereException (org.adempiere.exceptions.AdempiereException)7 GetMapping (org.springframework.web.bind.annotation.GetMapping)7 ViewId (de.metas.ui.web.view.ViewId)6 DocumentEntityDescriptor (de.metas.ui.web.window.descriptor.DocumentEntityDescriptor)6 NonNull (lombok.NonNull)6 Services (org.adempiere.util.Services)6 PostMapping (org.springframework.web.bind.annotation.PostMapping)6 EntityNotFoundException (de.metas.ui.web.exceptions.EntityNotFoundException)5 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)5 DocumentCollection (de.metas.ui.web.window.model.DocumentCollection)5