Search in sources :

Example 16 with HUEditorView

use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.

the class WEBUI_M_HU_Transform method updateViewFromResult.

private final void updateViewFromResult(final WebuiHUTransformCommandResult result) {
    final HUEditorView view = getView();
    boolean changes = false;
    if (view.addHUIds(result.getHuIdsToAddToView())) {
        changes = true;
    }
    if (view.removeHUIds(result.getHuIdsToRemoveFromView())) {
        changes = true;
    }
    if (!result.getHuIdsChanged().isEmpty()) {
        removeHUsIfDestroyed(result.getHuIdsChanged());
        changes = true;
    }
    if (removeSelectedRowsIfHUDestoyed()) {
        changes = true;
    }
    // 
    if (changes) {
        view.invalidateAll();
    }
}
Also used : HUEditorView(de.metas.ui.web.handlingunits.HUEditorView)

Example 17 with HUEditorView

use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.

the class HUReportProcessInstancesRepository method checkApplies.

private boolean checkApplies(final WebuiHUProcessDescriptor descriptor, @NonNull ViewAsPreconditionsContext viewContext) {
    final DocumentIdsSelection rowIds = viewContext.getSelectedRowIds();
    if (rowIds.isEmpty()) {
        return false;
    }
    final HUEditorView huView = viewContext.getView(HUEditorView.class);
    final boolean foundNotMatchingRows = huView.streamByIds(rowIds).anyMatch(row -> !checkApplies(row, descriptor));
    return !foundNotMatchingRows;
}
Also used : DocumentIdsSelection(de.metas.ui.web.window.datatypes.DocumentIdsSelection) HUEditorView(de.metas.ui.web.handlingunits.HUEditorView)

Aggregations

HUEditorView (de.metas.ui.web.handlingunits.HUEditorView)17 HUEditorRow (de.metas.ui.web.handlingunits.HUEditorRow)7 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)6 I_M_HU (de.metas.handlingunits.model.I_M_HU)5 HuId (de.metas.handlingunits.HuId)4 IHandlingUnitsBL (de.metas.handlingunits.IHandlingUnitsBL)4 IProcessPrecondition (de.metas.process.IProcessPrecondition)3 ProcessPreconditionsResolution (de.metas.process.ProcessPreconditionsResolution)3 DocumentCollection (de.metas.ui.web.window.model.DocumentCollection)3 ImmutableSet (com.google.common.collect.ImmutableSet)2 Param (de.metas.process.Param)2 HUEditorProcessTemplate (de.metas.ui.web.handlingunits.HUEditorProcessTemplate)2 PickingSlotView (de.metas.ui.web.picking.pickingslot.PickingSlotView)2 ViewId (de.metas.ui.web.view.ViewId)2 Collection (java.util.Collection)2 List (java.util.List)2 InterfaceWrapperHelper.load (org.adempiere.model.InterfaceWrapperHelper.load)2 Services (org.adempiere.util.Services)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 Splitter (com.google.common.base.Splitter)1