IDEMPIERE-144 Performance: Remove the use of zk event thread. Fixed more modal window that have been overlook due to the use of "modal" string instead of Window.MODE_MODAL constant.
This commit is contained in:
parent
3fd9af4e8a
commit
d0f745b345
|
@ -614,7 +614,6 @@ public class WAcctViewer extends Window implements EventListener
|
||||||
south.setHeight("26px");
|
south.setHeight("26px");
|
||||||
southPanel.setParent(south);
|
southPanel.setParent(south);
|
||||||
|
|
||||||
this.setAttribute("mode", "modal");
|
|
||||||
this.setTitle(TITLE);
|
this.setTitle(TITLE);
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
|
|
|
@ -58,7 +58,6 @@ public class WCreateFromWindow extends Window implements EventListener<Event>, W
|
||||||
public WCreateFromWindow(CreateFrom createFrom, int windowNo)
|
public WCreateFromWindow(CreateFrom createFrom, int windowNo)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
setAttribute("mode", "modal");
|
|
||||||
|
|
||||||
this.createFrom = createFrom;
|
this.createFrom = createFrom;
|
||||||
this.windowNo = windowNo;
|
this.windowNo = windowNo;
|
||||||
|
|
|
@ -6,10 +6,12 @@ import java.text.DateFormat;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.util.Callback;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.EditorBox;
|
import org.adempiere.webui.component.EditorBox;
|
||||||
import org.adempiere.webui.event.ContextMenuEvent;
|
import org.adempiere.webui.event.ContextMenuEvent;
|
||||||
import org.adempiere.webui.event.ContextMenuListener;
|
import org.adempiere.webui.event.ContextMenuListener;
|
||||||
|
import org.adempiere.webui.event.DialogEvents;
|
||||||
import org.adempiere.webui.event.ValueChangeEvent;
|
import org.adempiere.webui.event.ValueChangeEvent;
|
||||||
import org.adempiere.webui.window.InfoSchedule;
|
import org.adempiere.webui.window.InfoSchedule;
|
||||||
import org.adempiere.webui.window.WAssignmentDialog;
|
import org.adempiere.webui.window.WAssignmentDialog;
|
||||||
|
@ -21,6 +23,7 @@ import org.compiere.util.DB;
|
||||||
import org.compiere.util.DisplayType;
|
import org.compiere.util.DisplayType;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
|
||||||
public class WAssignmentEditor extends WEditor implements ContextMenuListener {
|
public class WAssignmentEditor extends WEditor implements ContextMenuListener {
|
||||||
|
@ -136,7 +139,7 @@ public class WAssignmentEditor extends WEditor implements ContextMenuListener {
|
||||||
//
|
//
|
||||||
if (Events.ON_CLICK.equalsIgnoreCase(event.getName()))
|
if (Events.ON_CLICK.equalsIgnoreCase(event.getName()))
|
||||||
{
|
{
|
||||||
Integer oldValue = (Integer)getValue();
|
final Integer oldValue = (Integer)getValue();
|
||||||
int S_ResourceAssignment_ID = oldValue == null ? 0 : oldValue.intValue();
|
int S_ResourceAssignment_ID = oldValue == null ? 0 : oldValue.intValue();
|
||||||
MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), S_ResourceAssignment_ID, null);
|
MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), S_ResourceAssignment_ID, null);
|
||||||
if (S_ResourceAssignment_ID == 0) {
|
if (S_ResourceAssignment_ID == 0) {
|
||||||
|
@ -151,23 +154,26 @@ public class WAssignmentEditor extends WEditor implements ContextMenuListener {
|
||||||
// Start VAssignment Dialog
|
// Start VAssignment Dialog
|
||||||
if (S_ResourceAssignment_ID != 0)
|
if (S_ResourceAssignment_ID != 0)
|
||||||
{
|
{
|
||||||
WAssignmentDialog vad = new WAssignmentDialog (ma, true, true);
|
final WAssignmentDialog vad = new WAssignmentDialog (ma, true, true);
|
||||||
ma = vad.getMResourceAssignment();
|
vad.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
MResourceAssignment ma = vad.getMResourceAssignment();
|
||||||
|
processNewValue(oldValue, ma);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AEnv.showWindow(vad);
|
||||||
}
|
}
|
||||||
// Start InfoSchedule directly
|
// Start InfoSchedule directly
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InfoSchedule is = new InfoSchedule(ma, true);
|
final InfoSchedule is = new InfoSchedule(ma, true, new Callback<MResourceAssignment>() {
|
||||||
ma = is.getMResourceAssignment();
|
@Override
|
||||||
}
|
public void onCallback(MResourceAssignment ma) {
|
||||||
|
processNewValue(oldValue, ma);
|
||||||
// Set Value
|
}
|
||||||
if (ma != null && ma.getS_ResourceAssignment_ID() != 0)
|
});
|
||||||
{
|
}
|
||||||
setValue(new Integer(ma.getS_ResourceAssignment_ID()));
|
|
||||||
ValueChangeEvent vce = new ValueChangeEvent(this, gridField.getColumnName(), oldValue, getValue());
|
|
||||||
fireValueChange(vce);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,4 +193,14 @@ public class WAssignmentEditor extends WEditor implements ContextMenuListener {
|
||||||
AEnv.zoom(gridField.getGridTab().getAD_Table_ID(), (Integer)getValue());
|
AEnv.zoom(gridField.getGridTab().getAD_Table_ID(), (Integer)getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void processNewValue(final Integer oldValue, MResourceAssignment ma) {
|
||||||
|
// Set Value
|
||||||
|
if (ma != null && ma.getS_ResourceAssignment_ID() != 0)
|
||||||
|
{
|
||||||
|
setValue(new Integer(ma.getS_ResourceAssignment_ID()));
|
||||||
|
ValueChangeEvent vce = new ValueChangeEvent(WAssignmentEditor.this, gridField.getColumnName(), oldValue, getValue());
|
||||||
|
fireValueChange(vce);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,10 @@ import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
|
|
||||||
import org.adempiere.webui.ValuePreference;
|
import org.adempiere.webui.ValuePreference;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.adempiere.webui.component.Locationbox;
|
import org.adempiere.webui.component.Locationbox;
|
||||||
import org.adempiere.webui.event.ContextMenuEvent;
|
import org.adempiere.webui.event.ContextMenuEvent;
|
||||||
import org.adempiere.webui.event.ContextMenuListener;
|
import org.adempiere.webui.event.ContextMenuListener;
|
||||||
|
import org.adempiere.webui.event.DialogEvents;
|
||||||
import org.adempiere.webui.event.ValueChangeEvent;
|
import org.adempiere.webui.event.ValueChangeEvent;
|
||||||
import org.adempiere.webui.window.WFieldRecordInfo;
|
import org.adempiere.webui.window.WFieldRecordInfo;
|
||||||
import org.adempiere.webui.window.WLocationDialog;
|
import org.adempiere.webui.window.WLocationDialog;
|
||||||
|
@ -163,28 +163,36 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
|
||||||
if ("onClick".equals(event.getName()))
|
if ("onClick".equals(event.getName()))
|
||||||
{
|
{
|
||||||
log.config( "actionPerformed - " + m_value);
|
log.config( "actionPerformed - " + m_value);
|
||||||
WLocationDialog ld = new WLocationDialog(Msg.getMsg(Env.getCtx(), "Location"), m_value);
|
final WLocationDialog ld = new WLocationDialog(Msg.getMsg(Env.getCtx(), "Location"), m_value);
|
||||||
ld.setVisible(true);
|
ld.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
AEnv.showWindow(ld);
|
|
||||||
m_value = ld.getValue();
|
@Override
|
||||||
//
|
public void onEvent(Event event) throws Exception {
|
||||||
if (!ld.isChanged())
|
m_value = ld.getValue();
|
||||||
return;
|
//
|
||||||
|
if (!ld.isChanged())
|
||||||
// Data Binding
|
return;
|
||||||
int C_Location_ID = 0;
|
|
||||||
if (m_value != null)
|
// Data Binding
|
||||||
C_Location_ID = m_value.getC_Location_ID();
|
int C_Location_ID = 0;
|
||||||
Integer ii = new Integer(C_Location_ID);
|
if (m_value != null)
|
||||||
// force Change - user does not realize that embedded object is already saved.
|
C_Location_ID = m_value.getC_Location_ID();
|
||||||
ValueChangeEvent valuechange = new ValueChangeEvent(this,getColumnName(),null,null);
|
Integer ii = new Integer(C_Location_ID);
|
||||||
fireValueChange(valuechange); // resets m_mLocation
|
// force Change - user does not realize that embedded object is already saved.
|
||||||
if (C_Location_ID != 0)
|
ValueChangeEvent valuechange = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,null);
|
||||||
{
|
fireValueChange(valuechange); // resets m_mLocation
|
||||||
ValueChangeEvent vc = new ValueChangeEvent(this,getColumnName(),null,ii);
|
if (C_Location_ID != 0)
|
||||||
fireValueChange(vc);
|
{
|
||||||
}
|
ValueChangeEvent vc = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,ii);
|
||||||
setValue(ii);
|
fireValueChange(vc);
|
||||||
|
}
|
||||||
|
setValue(ii);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getComponent().appendChild(ld);
|
||||||
|
ld.setPosition("parent");
|
||||||
|
ld.setTitle(null);
|
||||||
|
ld.doPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.EditorBox;
|
import org.adempiere.webui.component.EditorBox;
|
||||||
import org.adempiere.webui.event.ContextMenuEvent;
|
import org.adempiere.webui.event.ContextMenuEvent;
|
||||||
import org.adempiere.webui.event.ContextMenuListener;
|
import org.adempiere.webui.event.ContextMenuListener;
|
||||||
|
import org.adempiere.webui.event.DialogEvents;
|
||||||
import org.adempiere.webui.event.ValueChangeEvent;
|
import org.adempiere.webui.event.ValueChangeEvent;
|
||||||
import org.adempiere.webui.window.WFieldRecordInfo;
|
import org.adempiere.webui.window.WFieldRecordInfo;
|
||||||
import org.adempiere.webui.window.WLocatorDialog;
|
import org.adempiere.webui.window.WLocatorDialog;
|
||||||
|
@ -233,20 +234,25 @@ public class WLocatorEditor extends WEditor implements EventListener<Event>, Pro
|
||||||
m_mLocator.setOnly_Warehouse_ID(only_Warehouse_ID);
|
m_mLocator.setOnly_Warehouse_ID(only_Warehouse_ID);
|
||||||
m_mLocator.setOnly_Product_ID(getOnly_Product_ID());
|
m_mLocator.setOnly_Product_ID(getOnly_Product_ID());
|
||||||
|
|
||||||
WLocatorDialog ld = new WLocatorDialog(Msg.translate(Env.getCtx(), getColumnName()),
|
final WLocatorDialog ld = new WLocatorDialog(Msg.translate(Env.getCtx(), getColumnName()),
|
||||||
m_mLocator, M_Locator_ID, isMandatory(), only_Warehouse_ID, this.m_WindowNo);
|
m_mLocator, M_Locator_ID, isMandatory(), only_Warehouse_ID, this.m_WindowNo);
|
||||||
|
|
||||||
|
ld.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
m_mLocator.setOnly_Warehouse_ID(0);
|
||||||
|
// redisplay
|
||||||
|
|
||||||
|
if (!ld.isChanged())
|
||||||
|
return;
|
||||||
|
setValue (ld.getValue(), true);
|
||||||
|
}
|
||||||
|
});
|
||||||
// display
|
// display
|
||||||
ld.setVisible(true);
|
getComponent().appendChild(ld);
|
||||||
AEnv.showWindow(ld);
|
ld.setPosition("parent");
|
||||||
|
ld.setTitle(null);
|
||||||
m_mLocator.setOnly_Warehouse_ID(0);
|
ld.doPopup();
|
||||||
|
|
||||||
// redisplay
|
|
||||||
|
|
||||||
if (!ld.isChanged())
|
|
||||||
return;
|
|
||||||
setValue (ld.getValue(), true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -433,7 +433,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
|
||||||
|
|
||||||
private void actionBPartner (boolean newRecord)
|
private void actionBPartner (boolean newRecord)
|
||||||
{
|
{
|
||||||
WBPartner vbp = new WBPartner (lookup.getWindowNo());
|
final WBPartner vbp = new WBPartner (lookup.getWindowNo());
|
||||||
int BPartner_ID = 0;
|
int BPartner_ID = 0;
|
||||||
|
|
||||||
// if update, get current value
|
// if update, get current value
|
||||||
|
@ -447,23 +447,28 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
|
||||||
|
|
||||||
vbp.loadBPartner (BPartner_ID);
|
vbp.loadBPartner (BPartner_ID);
|
||||||
|
|
||||||
|
final int finalBPartner_ID = BPartner_ID;
|
||||||
|
vbp.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
// get result
|
||||||
|
int result = vbp.getC_BPartner_ID();
|
||||||
|
|
||||||
|
if (result == 0 // 0 = not saved
|
||||||
|
&& result == finalBPartner_ID) // the same
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Maybe new BPartner - put in cache
|
||||||
|
lookup.getDirect(new Integer(result), false, true);
|
||||||
|
setValue(new Integer(result));
|
||||||
|
actionCombo (new Integer(result)); // data binding
|
||||||
|
|
||||||
|
//setValue(getValue());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
vbp.setVisible(true);
|
vbp.setVisible(true);
|
||||||
AEnv.showWindow(vbp);
|
AEnv.showWindow(vbp);
|
||||||
|
|
||||||
// get result
|
|
||||||
int result = vbp.getC_BPartner_ID();
|
|
||||||
|
|
||||||
if (result == 0 // 0 = not saved
|
|
||||||
&& result == BPartner_ID) // the same
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Maybe new BPartner - put in cache
|
|
||||||
lookup.getDirect(new Integer(result), false, true);
|
|
||||||
setValue(new Integer(result));
|
|
||||||
actionCombo (new Integer(result)); // data binding
|
|
||||||
|
|
||||||
//setValue(getValue());
|
|
||||||
} // actionBPartner
|
} // actionBPartner
|
||||||
|
|
||||||
private void actionButton(String queryValue)
|
private void actionButton(String queryValue)
|
||||||
|
|
|
@ -141,7 +141,6 @@ public class WBPartner extends Window implements EventListener, ValueChangeListe
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
this.setTitle("Business Partner");
|
this.setTitle("Business Partner");
|
||||||
this.setAttribute("mode", "modal");
|
|
||||||
this.appendChild(centerPanel);
|
this.appendChild(centerPanel);
|
||||||
this.appendChild(confirmPanel);
|
this.appendChild(confirmPanel);
|
||||||
|
|
||||||
|
|
|
@ -883,9 +883,16 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
{
|
{
|
||||||
public void onEvent(Event event) throws Exception
|
public void onEvent(Event event) throws Exception
|
||||||
{
|
{
|
||||||
new WRecordAccessDialog(null, curTab.getAD_Table_ID(), curTab.getRecord_ID());
|
WRecordAccessDialog recordAccessDialog = new WRecordAccessDialog(null, curTab.getAD_Table_ID(), curTab.getRecord_ID());
|
||||||
|
recordAccessDialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
|
|
||||||
toolbar.lock(curTab.isLocked());
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
toolbar.lock(curTab.isLocked());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AEnv.showWindow(recordAccessDialog);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1753,7 +1760,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
||||||
if (callback != null)
|
if (callback != null)
|
||||||
callback.onCallback(false);
|
callback.onCallback(false);
|
||||||
return;
|
return;
|
||||||
} else if (!onSaveEvent && !navigationEvent) //need manual refresh
|
} else if (!onSaveEvent) //need manual refresh
|
||||||
{
|
{
|
||||||
curTab.setCurrentRow(curTab.getCurrentRow());
|
curTab.setCurrentRow(curTab.getCurrentRow());
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,10 @@ import java.util.Date;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.Panel;
|
import org.adempiere.webui.component.Panel;
|
||||||
import org.adempiere.webui.component.ToolBarButton;
|
import org.adempiere.webui.component.ToolBarButton;
|
||||||
|
import org.adempiere.webui.event.DialogEvents;
|
||||||
import org.adempiere.webui.window.InfoSchedule;
|
import org.adempiere.webui.window.InfoSchedule;
|
||||||
import org.adempiere.webui.window.WAssignmentDialog;
|
import org.adempiere.webui.window.WAssignmentDialog;
|
||||||
import org.compiere.model.MResourceAssignment;
|
import org.compiere.model.MResourceAssignment;
|
||||||
|
@ -182,11 +184,17 @@ public class WSchedule extends Panel implements EventListener
|
||||||
MouseEvent me = (MouseEvent) event;
|
MouseEvent me = (MouseEvent) event;
|
||||||
if (me.getX() > 0) {
|
if (me.getX() > 0) {
|
||||||
MResourceAssignment assignment = new MResourceAssignment(Env.getCtx(), me.getX(), null);
|
MResourceAssignment assignment = new MResourceAssignment(Env.getCtx(), me.getX(), null);
|
||||||
WAssignmentDialog wad = new WAssignmentDialog(assignment, false, infoSchedule.isCreateNew());
|
final WAssignmentDialog wad = new WAssignmentDialog(assignment, false, infoSchedule.isCreateNew());
|
||||||
if (!wad.isCancelled()) {
|
wad.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
_assignmentDialogResult = wad.getMResourceAssignment();
|
@Override
|
||||||
Events.echoEvent("onAssignmentCallback", this, null);
|
public void onEvent(Event event) throws Exception {
|
||||||
}
|
if (!wad.isCancelled()) {
|
||||||
|
_assignmentDialogResult = wad.getMResourceAssignment();
|
||||||
|
Events.echoEvent("onAssignmentCallback", WSchedule.this, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AEnv.showWindow(wad);
|
||||||
}
|
}
|
||||||
} else if (event instanceof BandScrollEvent){
|
} else if (event instanceof BandScrollEvent){
|
||||||
BandScrollEvent e = (BandScrollEvent) event;
|
BandScrollEvent e = (BandScrollEvent) event;
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Date;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.util.Callback;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
import org.adempiere.webui.component.ConfirmPanel;
|
import org.adempiere.webui.component.ConfirmPanel;
|
||||||
|
@ -38,6 +39,7 @@ import org.adempiere.webui.component.Listbox;
|
||||||
import org.adempiere.webui.component.Row;
|
import org.adempiere.webui.component.Row;
|
||||||
import org.adempiere.webui.component.Rows;
|
import org.adempiere.webui.component.Rows;
|
||||||
import org.adempiere.webui.component.Window;
|
import org.adempiere.webui.component.Window;
|
||||||
|
import org.adempiere.webui.event.DialogEvents;
|
||||||
import org.adempiere.webui.panel.StatusBarPanel;
|
import org.adempiere.webui.panel.StatusBarPanel;
|
||||||
import org.adempiere.webui.panel.WSchedule;
|
import org.adempiere.webui.panel.WSchedule;
|
||||||
import org.compiere.model.MAssignmentSlot;
|
import org.compiere.model.MAssignmentSlot;
|
||||||
|
@ -74,9 +76,11 @@ import org.zkoss.zul.Vbox;
|
||||||
public class InfoSchedule extends Window implements EventListener
|
public class InfoSchedule extends Window implements EventListener
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
* @param mAssignment optional assignment
|
||||||
|
* @param createNew if true, allows to create new assignments
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -5948901371276429661L;
|
private static final long serialVersionUID = -5948901371276429661L;
|
||||||
|
private Callback<MResourceAssignment> m_callback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -84,13 +88,24 @@ public class InfoSchedule extends Window implements EventListener
|
||||||
* @param createNew if true, allows to create new assignments
|
* @param createNew if true, allows to create new assignments
|
||||||
*/
|
*/
|
||||||
public InfoSchedule (MResourceAssignment mAssignment, boolean createNew)
|
public InfoSchedule (MResourceAssignment mAssignment, boolean createNew)
|
||||||
|
{
|
||||||
|
this(mAssignment, createNew, (Callback<MResourceAssignment>)null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param mAssignment optional assignment
|
||||||
|
* @param createNew if true, allows to create new assignments
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public InfoSchedule (MResourceAssignment mAssignment, boolean createNew, Callback<MResourceAssignment> callback)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
setTitle(Msg.getMsg(Env.getCtx(), "InfoSchedule"));
|
setTitle(Msg.getMsg(Env.getCtx(), "InfoSchedule"));
|
||||||
if (createNew)
|
if (createNew)
|
||||||
setAttribute("mode", "modal");
|
setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
|
||||||
else
|
else
|
||||||
setAttribute("mode", "overlapped");
|
setAttribute(Window.MODE_KEY, Window.MODE_OVERLAPPED);
|
||||||
this.setWidth("600px");
|
this.setWidth("600px");
|
||||||
// this.setHeight("600px");
|
// this.setHeight("600px");
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
|
@ -106,6 +121,15 @@ public class InfoSchedule extends Window implements EventListener
|
||||||
if (m_dateFrom == null)
|
if (m_dateFrom == null)
|
||||||
m_dateFrom = new Timestamp(System.currentTimeMillis());
|
m_dateFrom = new Timestamp(System.currentTimeMillis());
|
||||||
m_createNew = createNew;
|
m_createNew = createNew;
|
||||||
|
m_callback = callback;
|
||||||
|
if (callback != null) {
|
||||||
|
this.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
m_callback.onCallback(getMResourceAssignment());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
@ -114,8 +138,7 @@ public class InfoSchedule extends Window implements EventListener
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "InfoSchedule", ex);
|
log.log(Level.SEVERE, "InfoSchedule", ex);
|
||||||
}
|
}
|
||||||
AEnv.showWindow(this);
|
|
||||||
} // InfoSchedule
|
} // InfoSchedule
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -539,8 +562,14 @@ public class InfoSchedule extends Window implements EventListener
|
||||||
|
|
||||||
ma.setAssignDateFrom(TimeUtil.getDayTime(start, slot.getStartTime()));
|
ma.setAssignDateFrom(TimeUtil.getDayTime(start, slot.getStartTime()));
|
||||||
ma.setQty(new BigDecimal(1));
|
ma.setQty(new BigDecimal(1));
|
||||||
WAssignmentDialog vad = new WAssignmentDialog (ma, false, m_createNew);
|
final WAssignmentDialog vad = new WAssignmentDialog (ma, false, m_createNew);
|
||||||
mAssignmentCallback(vad.getMResourceAssignment());
|
vad.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
mAssignmentCallback(vad.getMResourceAssignment());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AEnv.showWindow(vad);
|
||||||
} else {
|
} else {
|
||||||
FDialog.error(0, this, "No available time slot for the selected day.");
|
FDialog.error(0, this, "No available time slot for the selected day.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import java.util.GregorianCalendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.util.Callback;
|
||||||
import org.adempiere.webui.LayoutUtils;
|
import org.adempiere.webui.LayoutUtils;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
|
@ -97,9 +98,8 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
{
|
{
|
||||||
super ();
|
super ();
|
||||||
this.setTitle(Msg.getMsg(Env.getCtx(), "VAssignmentDialog"));
|
this.setTitle(Msg.getMsg(Env.getCtx(), "VAssignmentDialog"));
|
||||||
this.setAttribute("mode", "modal");
|
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
|
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
|
||||||
log.config(mAssignment.toString());
|
log.config(mAssignment.toString());
|
||||||
m_mAssignment = mAssignment;
|
m_mAssignment = mAssignment;
|
||||||
try
|
try
|
||||||
|
@ -114,8 +114,7 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
log.log(Level.SEVERE, "", e);
|
log.log(Level.SEVERE, "", e);
|
||||||
}
|
}
|
||||||
setDisplay(); // from mAssignment
|
setDisplay(); // from mAssignment
|
||||||
//
|
//
|
||||||
AEnv.showWindow(this);
|
|
||||||
} // VAssignmentDialog
|
} // VAssignmentDialog
|
||||||
|
|
||||||
/** Assignment */
|
/** Assignment */
|
||||||
|
@ -378,14 +377,17 @@ public class WAssignmentDialog extends Window implements EventListener
|
||||||
// Zoom - InfoResource
|
// Zoom - InfoResource
|
||||||
else if (e.getTarget().getId().equals("Zoom"))
|
else if (e.getTarget().getId().equals("Zoom"))
|
||||||
{
|
{
|
||||||
InfoSchedule is = new InfoSchedule (m_mAssignment, true);
|
InfoSchedule is = new InfoSchedule (m_mAssignment, true, new Callback<MResourceAssignment>() {
|
||||||
if (is.getMResourceAssignment() != null)
|
@Override
|
||||||
{
|
public void onCallback(MResourceAssignment result) {
|
||||||
m_mAssignment = is.getMResourceAssignment();
|
if (result != null)
|
||||||
// setDisplay();
|
{
|
||||||
detach();
|
m_mAssignment = result;
|
||||||
}
|
// setDisplay();
|
||||||
is = null;
|
detach();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// cancel - return
|
// cancel - return
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class WFieldRecordInfo extends Window implements EventListener
|
||||||
{
|
{
|
||||||
super ();
|
super ();
|
||||||
this.setTitle(title);
|
this.setTitle(title);
|
||||||
this.setAttribute("modal", Boolean.TRUE);
|
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
|
||||||
this.setWidth("640px");
|
this.setWidth("640px");
|
||||||
this.setHeight("480px");
|
this.setHeight("480px");
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class WLocationDialog extends Window implements EventListener
|
||||||
this.setWidth("380px");
|
this.setWidth("380px");
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
this.setAttribute("mode","modal");
|
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initComponents()
|
private void initComponents()
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.webui.LayoutUtils;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
import org.adempiere.webui.component.Checkbox;
|
import org.adempiere.webui.component.Checkbox;
|
||||||
import org.adempiere.webui.component.Label;
|
import org.adempiere.webui.component.Label;
|
||||||
|
@ -44,6 +45,7 @@ import org.compiere.util.Msg;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
import org.zkoss.zul.Cell;
|
||||||
import org.zkoss.zul.Hbox;
|
import org.zkoss.zul.Hbox;
|
||||||
import org.zkoss.zul.Separator;
|
import org.zkoss.zul.Separator;
|
||||||
import org.zkoss.zul.Vbox;
|
import org.zkoss.zul.Vbox;
|
||||||
|
@ -146,69 +148,112 @@ public class WLocatorDialog extends Window implements EventListener
|
||||||
|
|
||||||
Hbox boxLocator = new Hbox();
|
Hbox boxLocator = new Hbox();
|
||||||
boxLocator.setWidth("100%");
|
boxLocator.setWidth("100%");
|
||||||
boxLocator.setWidths("30%, 70%");
|
|
||||||
|
|
||||||
lstLocator.setWidth("150px"); // Elaine 2009/02/02 - fixed the locator width
|
lstLocator.setWidth("150px"); // Elaine 2009/02/02 - fixed the locator width
|
||||||
lstLocator.setMold("select");
|
lstLocator.setMold("select");
|
||||||
lstLocator.setRows(0);
|
lstLocator.setRows(0);
|
||||||
|
LayoutUtils.addSclass("z-label", lstLocator);
|
||||||
|
|
||||||
boxLocator.appendChild(lblLocator);
|
Cell cell = new Cell();
|
||||||
boxLocator.appendChild(lstLocator);
|
cell.setWidth("30%");
|
||||||
|
boxLocator.appendChild(cell);
|
||||||
|
cell.appendChild(lblLocator);
|
||||||
|
cell = new Cell();
|
||||||
|
cell.setWidth("70%");
|
||||||
|
boxLocator.appendChild(cell);
|
||||||
|
cell.appendChild(lstLocator);
|
||||||
|
|
||||||
Hbox boxCheckbox = new Hbox();
|
Hbox boxCheckbox = new Hbox();
|
||||||
boxCheckbox.setWidth("100%");
|
boxCheckbox.setWidth("100%");
|
||||||
boxCheckbox.setWidths("30%, 70%");
|
boxCheckbox.setPack("start");
|
||||||
boxCheckbox.setStyle("text-align:left");
|
|
||||||
|
|
||||||
chkCreateNew.setLabel(Msg.getMsg(Env.getCtx(), "CreateNew"));
|
chkCreateNew.setLabel(Msg.getMsg(Env.getCtx(), "CreateNew"));
|
||||||
|
|
||||||
boxCheckbox.appendChild(new Label());
|
cell = new Cell();
|
||||||
boxCheckbox.appendChild(chkCreateNew);
|
cell.setWidth("100%");
|
||||||
|
boxCheckbox.appendChild(cell);
|
||||||
|
cell.appendChild(chkCreateNew);
|
||||||
|
|
||||||
Hbox boxWarehouse = new Hbox();
|
Hbox boxWarehouse = new Hbox();
|
||||||
boxWarehouse.setWidth("100%");
|
boxWarehouse.setWidth("100%");
|
||||||
boxWarehouse.setWidths("30%, 70%");
|
boxWarehouse.setHflex("true");
|
||||||
|
|
||||||
lstWarehouse.setWidth("100px");
|
lstWarehouse.setWidth("100px");
|
||||||
lstWarehouse.setMold("select");
|
lstWarehouse.setMold("select");
|
||||||
lstWarehouse.setRows(0);
|
lstWarehouse.setRows(0);
|
||||||
|
LayoutUtils.addSclass("z-label", lstWarehouse);
|
||||||
boxWarehouse.appendChild(lblWarehouse);
|
|
||||||
boxWarehouse.appendChild(lstWarehouse);
|
cell = new Cell();
|
||||||
boxWarehouse.appendChild(txtWarehouse);
|
cell.setWidth("30%");
|
||||||
|
boxWarehouse.appendChild(cell);
|
||||||
|
cell.appendChild(lblWarehouse);
|
||||||
|
lblWarehouse.setHflex("true");
|
||||||
|
cell = new Cell();
|
||||||
|
cell.setWidth("70%");
|
||||||
|
boxWarehouse.appendChild(cell);
|
||||||
|
cell.appendChild(lstWarehouse);
|
||||||
|
cell.appendChild(txtWarehouse);
|
||||||
|
|
||||||
Hbox boxAisle = new Hbox();
|
Hbox boxAisle = new Hbox();
|
||||||
boxAisle.setWidth("100%");
|
boxAisle.setWidth("100%");
|
||||||
boxAisle.setWidths("30%, 70%");
|
boxAisle.setHflex("true");
|
||||||
|
|
||||||
boxAisle.appendChild(lblAisleX);
|
cell = new Cell();
|
||||||
boxAisle.appendChild(txtAisleX);
|
cell.setWidth("30%");
|
||||||
|
boxAisle.appendChild(cell);
|
||||||
|
lblAisleX.setHflex("true");
|
||||||
|
cell.appendChild(lblAisleX);
|
||||||
|
cell = new Cell();
|
||||||
|
cell.setWidth("70%");
|
||||||
|
boxAisle.appendChild(cell);
|
||||||
|
cell.appendChild(txtAisleX);
|
||||||
|
|
||||||
Hbox boxBin = new Hbox();
|
Hbox boxBin = new Hbox();
|
||||||
boxBin.setWidth("100%");
|
boxBin.setWidth("100%");
|
||||||
boxBin.setWidths("30%, 70%");
|
boxBin.setHflex("true");
|
||||||
|
|
||||||
boxBin.appendChild(lblBinY);
|
cell = new Cell();
|
||||||
boxBin.appendChild(txtBinY);
|
cell.setWidth("30%");
|
||||||
|
boxBin.appendChild(cell);
|
||||||
|
cell.appendChild(lblBinY);
|
||||||
|
lblBinY.setHflex("true");
|
||||||
|
cell = new Cell();
|
||||||
|
cell.setWidth("70%");
|
||||||
|
boxBin.appendChild(cell);
|
||||||
|
cell.appendChild(txtBinY);
|
||||||
|
|
||||||
Hbox boxLevel = new Hbox();
|
Hbox boxLevel = new Hbox();
|
||||||
boxLevel.setWidth("100%");
|
boxLevel.setWidth("100%");
|
||||||
boxLevel.setWidths("30%, 70%");
|
boxLevel.setHflex("true");
|
||||||
|
|
||||||
boxLevel.appendChild(lblLevelZ);
|
cell = new Cell();
|
||||||
boxLevel.appendChild(txtLevelZ);
|
cell.setWidth("30%");
|
||||||
|
boxLevel.appendChild(cell);
|
||||||
|
cell.appendChild(lblLevelZ);
|
||||||
|
lblLevelZ.setHflex("true");
|
||||||
|
cell = new Cell();
|
||||||
|
cell.setWidth("70%");
|
||||||
|
boxLevel.appendChild(cell);
|
||||||
|
cell.appendChild(txtLevelZ);
|
||||||
|
|
||||||
Hbox boxKey = new Hbox();
|
Hbox boxKey = new Hbox();
|
||||||
boxKey.setWidth("100%");
|
boxKey.setWidth("100%");
|
||||||
boxKey.setWidths("30%, 70%");
|
boxKey.setHflex("true");
|
||||||
|
|
||||||
boxKey.appendChild(lblKey);
|
cell = new Cell();
|
||||||
boxKey.appendChild(txtKey);
|
cell.setWidth("30%");
|
||||||
|
boxKey.appendChild(cell);
|
||||||
|
cell.appendChild(lblKey);
|
||||||
|
lblKey.setHflex("true");
|
||||||
|
cell = new Cell();
|
||||||
|
cell.setWidth("70%");
|
||||||
|
boxKey.appendChild(cell);
|
||||||
|
cell.appendChild(txtKey);
|
||||||
|
|
||||||
Hbox boxButtons = new Hbox();
|
Hbox boxButtons = new Hbox();
|
||||||
boxButtons.setWidth("100%");
|
boxButtons.setWidth("100%");
|
||||||
boxButtons.setWidths("80%, 10%, 10%");
|
boxButtons.setStyle("padding: 5px;");
|
||||||
boxButtons.setStyle("text-align:right");
|
boxButtons.setPack("end");
|
||||||
|
|
||||||
btnCancel.setImage("/images/Cancel16.png");
|
btnCancel.setImage("/images/Cancel16.png");
|
||||||
btnCancel.addEventListener(Events.ON_CLICK, this);
|
btnCancel.addEventListener(Events.ON_CLICK, this);
|
||||||
|
@ -216,7 +261,6 @@ public class WLocatorDialog extends Window implements EventListener
|
||||||
btnOk.setImage("/images/Ok16.png");
|
btnOk.setImage("/images/Ok16.png");
|
||||||
btnOk.addEventListener(Events.ON_CLICK, this);
|
btnOk.addEventListener(Events.ON_CLICK, this);
|
||||||
|
|
||||||
boxButtons.appendChild(new Label());
|
|
||||||
boxButtons.appendChild(btnCancel);
|
boxButtons.appendChild(btnCancel);
|
||||||
boxButtons.appendChild(btnOk);
|
boxButtons.appendChild(btnOk);
|
||||||
|
|
||||||
|
@ -239,7 +283,6 @@ public class WLocatorDialog extends Window implements EventListener
|
||||||
this.setClosable(true);
|
this.setClosable(true);
|
||||||
this.setBorder("normal");
|
this.setBorder("normal");
|
||||||
this.setWidth("260Px");
|
this.setWidth("260Px");
|
||||||
this.setAttribute("mode","modal");
|
|
||||||
this.setSizable(true); // Elaine 2009/02/02 - window set to resizable
|
this.setSizable(true); // Elaine 2009/02/02 - window set to resizable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class WRecordAccessDialog extends Window implements EventListener
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
setTitle(Msg.translate(Env.getCtx(), "RecordAccessDialog"));
|
setTitle(Msg.translate(Env.getCtx(), "RecordAccessDialog"));
|
||||||
setAttribute("modal", Boolean.TRUE);
|
setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
|
||||||
setBorder("normal");
|
setBorder("normal");
|
||||||
setWidth("600px");
|
setWidth("600px");
|
||||||
setSizable(true);
|
setSizable(true);
|
||||||
|
@ -79,8 +79,7 @@ public class WRecordAccessDialog extends Window implements EventListener
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "", e);
|
log.log(Level.SEVERE, "", e);
|
||||||
}
|
}
|
||||||
AEnv.showWindow(this);
|
|
||||||
} // RecordAccessDialog
|
} // RecordAccessDialog
|
||||||
|
|
||||||
private int m_AD_Table_ID;
|
private int m_AD_Table_ID;
|
||||||
|
|
Loading…
Reference in New Issue