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:
Heng Sin Low 2012-08-20 12:40:08 +08:00
parent 3fd9af4e8a
commit d0f745b345
15 changed files with 249 additions and 129 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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,22 +154,25 @@ 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);
}
}
} }

View File

@ -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,9 +163,11 @@ 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);
@Override
public void onEvent(Event event) throws Exception {
m_value = ld.getValue(); m_value = ld.getValue();
// //
if (!ld.isChanged()) if (!ld.isChanged())
@ -177,15 +179,21 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
C_Location_ID = m_value.getC_Location_ID(); C_Location_ID = m_value.getC_Location_ID();
Integer ii = new Integer(C_Location_ID); Integer ii = new Integer(C_Location_ID);
// force Change - user does not realize that embedded object is already saved. // force Change - user does not realize that embedded object is already saved.
ValueChangeEvent valuechange = new ValueChangeEvent(this,getColumnName(),null,null); ValueChangeEvent valuechange = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,null);
fireValueChange(valuechange); // resets m_mLocation fireValueChange(valuechange); // resets m_mLocation
if (C_Location_ID != 0) if (C_Location_ID != 0)
{ {
ValueChangeEvent vc = new ValueChangeEvent(this,getColumnName(),null,ii); ValueChangeEvent vc = new ValueChangeEvent(WLocationEditor.this,getColumnName(),null,ii);
fireValueChange(vc); fireValueChange(vc);
} }
setValue(ii); setValue(ii);
} }
});
getComponent().appendChild(ld);
ld.setPosition("parent");
ld.setTitle(null);
ld.doPopup();
}
} }
/** /**

View File

@ -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,21 +234,26 @@ 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);
// display ld.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
ld.setVisible(true); @Override
AEnv.showWindow(ld); public void onEvent(Event event) throws Exception {
m_mLocator.setOnly_Warehouse_ID(0); m_mLocator.setOnly_Warehouse_ID(0);
// redisplay // redisplay
if (!ld.isChanged()) if (!ld.isChanged())
return; return;
setValue (ld.getValue(), true); setValue (ld.getValue(), true);
} }
});
// display
getComponent().appendChild(ld);
ld.setPosition("parent");
ld.setTitle(null);
ld.doPopup();
}
} }
public void actionRefresh() public void actionRefresh()

View File

@ -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,15 +447,15 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
vbp.loadBPartner (BPartner_ID); vbp.loadBPartner (BPartner_ID);
final int finalBPartner_ID = BPartner_ID;
vbp.setVisible(true); vbp.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
AEnv.showWindow(vbp); @Override
public void onEvent(Event event) throws Exception {
// get result // get result
int result = vbp.getC_BPartner_ID(); int result = vbp.getC_BPartner_ID();
if (result == 0 // 0 = not saved if (result == 0 // 0 = not saved
&& result == BPartner_ID) // the same && result == finalBPartner_ID) // the same
return; return;
// Maybe new BPartner - put in cache // Maybe new BPartner - put in cache
@ -464,6 +464,11 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
actionCombo (new Integer(result)); // data binding actionCombo (new Integer(result)); // data binding
//setValue(getValue()); //setValue(getValue());
}
});
vbp.setVisible(true);
AEnv.showWindow(vbp);
} // actionBPartner } // actionBPartner
private void actionButton(String queryValue) private void actionButton(String queryValue)

View File

@ -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);

View File

@ -883,12 +883,19 @@ 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>() {
@Override
public void onEvent(Event event) throws Exception {
toolbar.lock(curTab.isLocked()); toolbar.lock(curTab.isLocked());
} }
}); });
AEnv.showWindow(recordAccessDialog);
}
});
m_popup.setPage(toolbar.getButton("Lock").getPage()); m_popup.setPage(toolbar.getButton("Lock").getPage());
} }
m_popup.open(toolbar.getButton("Lock")); m_popup.open(toolbar.getButton("Lock"));
@ -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());
} }

View File

@ -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,12 +184,18 @@ 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());
wad.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
if (!wad.isCancelled()) { if (!wad.isCancelled()) {
_assignmentDialogResult = wad.getMResourceAssignment(); _assignmentDialogResult = wad.getMResourceAssignment();
Events.echoEvent("onAssignmentCallback", this, null); 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;
Date end = e.getMax(); Date end = e.getMax();

View File

@ -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();
@ -115,7 +139,6 @@ public class InfoSchedule extends Window implements EventListener
{ {
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);
vad.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
mAssignmentCallback(vad.getMResourceAssignment()); 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.");
} }

View File

@ -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
@ -115,7 +115,6 @@ public class WAssignmentDialog extends Window implements EventListener
} }
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) {
if (result != null)
{ {
m_mAssignment = is.getMResourceAssignment(); m_mAssignment = result;
// setDisplay(); // setDisplay();
detach(); detach();
} }
is = null; }
});
} }
// cancel - return // cancel - return

View File

@ -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");

View File

@ -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()

View File

@ -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); cell = new Cell();
boxWarehouse.appendChild(lstWarehouse); cell.setWidth("30%");
boxWarehouse.appendChild(txtWarehouse); 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
} }

View File

@ -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);
@ -80,7 +80,6 @@ public class WRecordAccessDialog extends Window implements EventListener
{ {
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;