Search in sources :

Example 31 with LookupValue

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

the class OrderLineQuickInputDescriptorFactory method onProductChangedCallout.

private static void onProductChangedCallout(final ICalloutField calloutField) {
    final QuickInput quickInput = QuickInput.getQuickInputOrNull(calloutField);
    if (quickInput == null) {
        return;
    }
    final IOrderLineQuickInput quickInputModel = quickInput.getQuickInputDocumentAs(IOrderLineQuickInput.class);
    final LookupValue productLookupValue = quickInputModel.getM_Product_ID();
    if (productLookupValue == null) {
        return;
    }
    final ProductAndAttributes productAndAttributes = ProductLookupDescriptor.toProductAndAttributes(productLookupValue);
    final I_M_Product quickInputProduct = load(productAndAttributes.getProductId(), I_M_Product.class);
    final I_C_Order order = quickInput.getRootDocumentAs(I_C_Order.class);
    Services.get(IHUOrderBL.class).findM_HU_PI_Item_Product(order, quickInputProduct, quickInputModel::setM_HU_PI_Item_Product);
}
Also used : I_C_Order(de.metas.adempiere.model.I_C_Order) I_M_Product(org.compiere.model.I_M_Product) QuickInput(de.metas.ui.web.quickinput.QuickInput) IHUOrderBL(de.metas.handlingunits.order.api.IHUOrderBL) ProductAndAttributes(de.metas.ui.web.window.descriptor.sql.ProductLookupDescriptor.ProductAndAttributes) IntegerLookupValue(de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue) LookupValue(de.metas.ui.web.window.datatypes.LookupValue)

Aggregations

LookupValue (de.metas.ui.web.window.datatypes.LookupValue)31 IntegerLookupValue (de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue)25 LookupValuesList (de.metas.ui.web.window.datatypes.LookupValuesList)7 JSONLookupValue (de.metas.ui.web.window.datatypes.json.JSONLookupValue)6 ITranslatableString (de.metas.i18n.ITranslatableString)5 AdempiereException (org.adempiere.exceptions.AdempiereException)4 Map (java.util.Map)3 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 IHUOrderBL (de.metas.handlingunits.order.api.IHUOrderBL)2 NumberTranslatableString (de.metas.i18n.NumberTranslatableString)2 BoilerPlateContext (de.metas.letters.model.MADBoilerPlate.BoilerPlateContext)2 ProcessInfoParameter (de.metas.process.ProcessInfoParameter)2 QuickInput (de.metas.ui.web.quickinput.QuickInput)2 DocumentPath (de.metas.ui.web.window.datatypes.DocumentPath)2 StringLookupValue (de.metas.ui.web.window.datatypes.LookupValue.StringLookupValue)2 Password (de.metas.ui.web.window.datatypes.Password)2 JSONDate (de.metas.ui.web.window.datatypes.json.JSONDate)2 JSONDocumentPath (de.metas.ui.web.window.datatypes.json.JSONDocumentPath)2 JSONLookupValuesList (de.metas.ui.web.window.datatypes.json.JSONLookupValuesList)2