IDEMPIERE-5265 : Wizard for Chosen Multiple Selection List editor - only for MultipleSelectionList editors / available for process parameters (#1454)

* IDEMPIERE-5265 : Wizard for Chosen Multiple Selection List editor

Do not show Assistant for TableDir editors
Show Assistant for process parameters

* IDEMPIERE-5265 : Wizard for Chosen Multiple Selection List editor - Show Assistant for process parameters

Better code from @hengsin

* IDEMPIERE-5265 : Wizard for Chosen Multiple Selection List editor - only for MultipleSelectionList editors

Comment to explicitely state that the Assistant is for MultipleSelectionList editors only (ie not
for MultipleSelectionTable editors)
This commit is contained in:
Nicolas Micoud 2022-08-29 11:21:46 +02:00 committed by GitHub
parent d0d42ffaf1
commit 527ccfcf35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 13 deletions

View File

@ -45,12 +45,12 @@ import org.adempiere.webui.util.ZKUpdateUtil;
import org.adempiere.webui.window.WFieldRecordInfo;
import org.compiere.model.GridField;
import org.compiere.model.Lookup;
import org.compiere.model.MColumn;
import org.compiere.model.MLookup;
import org.compiere.model.MRefList;
import org.compiere.util.CCache;
import org.compiere.util.CLogger;
import org.compiere.util.CacheMgt;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
@ -255,6 +255,7 @@ public class WChosenboxListEditor extends WEditor implements ContextMenuListener
popupMenu = new WEditorPopupMenu(false, true, isShowPreference(), false, false, false, lookup);
addChangeLogMenu(popupMenu);
if (gridField.getDisplayType() == DisplayType.ChosenMultipleSelectionList) { // The Assistant must be shown for MultipleSelectionList only (not for MultipleSelectionTable editors)
Menuitem editor = new Menuitem();
editor.setAttribute("EVENT", WEditorPopupMenu.ASSISTANT_EVENT);
editor.setLabel(Msg.getMsg(Env.getCtx(), "Assistant"));
@ -266,6 +267,7 @@ public class WChosenboxListEditor extends WEditor implements ContextMenuListener
popupMenu.appendChild(editor);
}
}
}
/**
* refresh lookup list
@ -681,7 +683,7 @@ public class WChosenboxListEditor extends WEditor implements ContextMenuListener
}
private class WChosenboxListAssistant extends Window implements EventListener<Event> {
private static final long serialVersionUID = 1223690858387209211L;
private static final long serialVersionUID = 1043859495570181469L;
private Button bAdd, bRemove, bUp, bDown;
private SimpleListModel availableModel = new SimpleListModel();
private SimpleListModel selectedModel = new SimpleListModel();
@ -694,7 +696,7 @@ public class WChosenboxListEditor extends WEditor implements ContextMenuListener
public WChosenboxListAssistant() {
super();
refID = MColumn.get(Env.getCtx(), gridTab.getTableName(), gridField.getColumnName()).getAD_Reference_Value_ID();
refID = gridField.getAD_Reference_Value_ID();
setTitle(gridField.getHeader() + " " + Msg.getMsg(Env.getCtx(), "Assistant"));
init();
load();