Info window enhancement:

* Info should be non-modal when not open as lookup ( that's how the swing client perform now )
* Layout refinement
* Always open the progress indicator when running query
* InfoProductPanel missing status bar
* Don't show ok button when info is not open as lookup. The ok and cancel button behave the same when info is in non-lookup mode, confusing and unnecessary.
Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2983129
This commit is contained in:
Heng Sin Low 2010-04-07 10:17:14 +00:00
parent fc14e5201c
commit 793b7f28f4
12 changed files with 723 additions and 204 deletions

View File

@ -42,7 +42,13 @@ import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
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.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox;
/** /**
* Based on InfoPayment written by Jorg Janke * Based on InfoPayment written by Jorg Janke
@ -90,9 +96,26 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev
private Label labelValue = new Label(); private Label labelValue = new Label();
private Label labelName = new Label(); private Label labelName = new Label();
private Borderlayout layout;
private Vbox southBody;
/** /**
* Standard Constructor * Standard Constructor
* @param WindowNo window no
* @param A_Asset_ID asset
* @param value Query Value or Name if enclosed in @
* @param multiSelection multiple selections
* @param whereClause where clause
*/
public InfoAssetPanel( int WindowNo, int A_Asset_ID, String value,
boolean multiSelection, String whereClause)
{
this(WindowNo, A_Asset_ID, value, multiSelection, whereClause, true);
}
/**
* Standard Constructor
* @param WindowNo window no * @param WindowNo window no
* @param A_Asset_ID asset * @param A_Asset_ID asset
* @param value Query Value or Name if enclosed in @ * @param value Query Value or Name if enclosed in @
@ -101,9 +124,9 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev
*/ */
public InfoAssetPanel( int WindowNo, int A_Asset_ID, String value, public InfoAssetPanel( int WindowNo, int A_Asset_ID, String value,
boolean multiSelection, String whereClause) boolean multiSelection, String whereClause, boolean lookup)
{ {
super (WindowNo, "a", "A_Asset_ID", multiSelection, whereClause); super (WindowNo, "a", "A_Asset_ID", multiSelection, whereClause, lookup);
log.info(value + ", ID=" + A_Asset_ID + ", WHERE=" + whereClause); log.info(value + ", ID=" + A_Asset_ID + ", WHERE=" + whereClause);
setTitle(Msg.getMsg(Env.getCtx(), "InfoAsset")); setTitle(Msg.getMsg(Env.getCtx(), "InfoAsset"));
@ -166,20 +189,40 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev
row.appendChild(fProduct_ID.getLabel().rightAlign()); row.appendChild(fProduct_ID.getLabel().rightAlign());
row.appendChild(fProduct_ID.getComponent()); row.appendChild(fProduct_ID.getComponent());
contentPanel.setWidth("99%"); layout = new Borderlayout();
contentPanel.setHeight("400px"); layout.setWidth("100%");
contentPanel.setVflex(true); layout.setHeight("100%");
if (!isLookup())
{
layout.setStyle("position: absolute");
}
this.appendChild(layout);
this.setWidth("850px"); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.appendChild(grid);
this.appendChild(new Separator()); Center center = new Center();
this.appendChild(contentPanel); layout.appendChild(center);
this.appendChild(new Separator()); center.setFlex(true);
this.appendChild(confirmPanel); Div div = new Div();
this.appendChild(new Separator()); div.appendChild(contentPanel);
this.appendChild(statusBar); if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -402,4 +445,10 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev
} }
} }
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
}
} }

View File

@ -47,8 +47,13 @@ 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.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox;
/** /**
* Based on InfoAssignment written by Jorg Janke * Based on InfoAssignment written by Jorg Janke
@ -77,6 +82,8 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val
private Label labelFrom = new Label(Msg.translate(Env.getCtx(), "DateFrom")); private Label labelFrom = new Label(Msg.translate(Env.getCtx(), "DateFrom"));
private Label labelTo = new Label(Msg.translate(Env.getCtx(), "DateTo")); private Label labelTo = new Label(Msg.translate(Env.getCtx(), "DateTo"));
private Borderlayout layout;
private Vbox southBody;
/** From Clause */ /** From Clause */
private static String s_assignmentFROM = private static String s_assignmentFROM =
@ -106,12 +113,25 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val
* @param multiSelection multiple selection * @param multiSelection multiple selection
* @param whereClause where clause * @param whereClause where clause
*/ */
public InfoAssignmentPanel (int WindowNo, public InfoAssignmentPanel (int WindowNo,
String value, boolean multiSelection, String whereClause) String value, boolean multiSelection, String whereClause)
{
this(WindowNo, value, multiSelection, whereClause, true);
}
/**
* Constructor
*
* @param WindowNo WindowNo
* @param value Query value Name or Value if contains numbers
* @param multiSelection multiple selection
* @param whereClause where clause
*/
public InfoAssignmentPanel (int WindowNo,
String value, boolean multiSelection, String whereClause, boolean lookup)
{ {
super (WindowNo, "ra", "S_ResourceAssignment_ID", super (WindowNo, "ra", "S_ResourceAssignment_ID",
multiSelection, whereClause); multiSelection, whereClause, lookup);
log.info(value); log.info(value);
setTitle(Msg.getMsg(Env.getCtx(), "InfoAssignment")); setTitle(Msg.getMsg(Env.getCtx(), "InfoAssignment"));
@ -201,20 +221,40 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val
row.appendChild(div); row.appendChild(div);
row.appendChild(bNew); row.appendChild(bNew);
contentPanel.setWidth("99%"); layout = new Borderlayout();
contentPanel.setHeight("400px"); layout.setWidth("100%");
contentPanel.setVflex(true); layout.setHeight("100%");
if (!isLookup())
{
layout.setStyle("position: absolute");
}
this.appendChild(layout);
this.setWidth("850px"); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.appendChild(grid);
this.appendChild(new Separator()); Center center = new Center();
this.appendChild(contentPanel); layout.appendChild(center);
this.appendChild(new Separator()); center.setFlex(true);
this.appendChild(confirmPanel); div = new Div();
this.appendChild(new Separator()); div.appendChild(contentPanel);
this.appendChild(statusBar); if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -391,7 +431,13 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val
public void tableChanged(WTableModelEvent event) public void tableChanged(WTableModelEvent event)
{ {
}
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
} }
} }

View File

@ -42,8 +42,13 @@ import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
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.Intbox; import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox;
/** /**
* Search Business Partner and return selection * Search Business Partner and return selection
@ -71,9 +76,9 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
private Label lblEMail ; private Label lblEMail ;
private Textbox fieldEMail; private Textbox fieldEMail;
private Label lblPostal; private Label lblPostal;
private Intbox fieldPostal; private Textbox fieldPostal;
private Label lblPhone; private Label lblPhone;
private Intbox fieldPhone; private Textbox fieldPhone;
private Checkbox checkAND ; private Checkbox checkAND ;
private Checkbox checkCustomer; private Checkbox checkCustomer;
@ -85,6 +90,8 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
/** Logger */ /** Logger */
protected CLogger log = CLogger.getCLogger(getClass()); protected CLogger log = CLogger.getCLogger(getClass());
private Borderlayout layout;
private Vbox southBody;
/** From Clause */ /** From Clause */
private static String s_partnerFROM = "C_BPartner" private static String s_partnerFROM = "C_BPartner"
@ -118,7 +125,19 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
*/ */
public InfoBPartnerPanel(String queryValue,int windowNo, boolean isSOTrx,boolean multipleSelection, String whereClause) public InfoBPartnerPanel(String queryValue,int windowNo, boolean isSOTrx,boolean multipleSelection, String whereClause)
{ {
super (windowNo, "C_BPartner", "C_BPartner_ID",multipleSelection, whereClause); this(queryValue, windowNo, isSOTrx, multipleSelection, whereClause, true);
}
/**
* Standard Constructor
* @param queryvalue Query value Name or Value if contains numbers
* @param isSOTrx if false, query vendors only
* @param whereClause where clause
*/
public InfoBPartnerPanel(String queryValue,int windowNo, boolean isSOTrx,boolean multipleSelection, String whereClause, boolean lookup)
{
super (windowNo, "C_BPartner", "C_BPartner_ID",multipleSelection, whereClause, lookup);
setTitle(Msg.getMsg(Env.getCtx(), "InfoBPartner")); setTitle(Msg.getMsg(Env.getCtx(), "InfoBPartner"));
m_isSOTrx = isSOTrx; m_isSOTrx = isSOTrx;
initComponents(); initComponents();
@ -161,9 +180,9 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
fieldContact.setMaxlength(40); fieldContact.setMaxlength(40);
fieldEMail = new Textbox(); fieldEMail = new Textbox();
fieldEMail.setMaxlength(40); fieldEMail.setMaxlength(40);
fieldPostal = new Intbox(); fieldPostal = new Textbox();
fieldPostal.setMaxlength(40); fieldPostal.setMaxlength(40);
fieldPhone = new Intbox(); fieldPhone = new Textbox();
fieldPhone.setMaxlength(40); fieldPhone.setMaxlength(40);
checkAND = new Checkbox(); checkAND = new Checkbox();
@ -177,10 +196,6 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
checkCustomer.setLabel(Msg.getMsg(Env.getCtx(), "OnlyCustomers")); checkCustomer.setLabel(Msg.getMsg(Env.getCtx(), "OnlyCustomers"));
else else
checkCustomer.setLabel(Msg.getMsg(Env.getCtx(), "OnlyVendors")); checkCustomer.setLabel(Msg.getMsg(Env.getCtx(), "OnlyVendors"));
contentPanel.setWidth("99%");
contentPanel.setHeight("400px");
contentPanel.setVflex(true);
} }
private void init() private void init()
@ -218,17 +233,40 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
row.appendChild(fieldPostal); row.appendChild(fieldPostal);
row.appendChild(checkAND); row.appendChild(checkAND);
this.appendChild(grid); layout = new Borderlayout();
this.appendChild(new Separator()); layout.setWidth("100%");
this.appendChild(contentPanel); layout.setHeight("100%");
this.appendChild(new Separator()); if (!isLookup())
this.appendChild(confirmPanel); {
this.appendChild(new Separator()); layout.setStyle("position: absolute");
this.appendChild(statusBar); }
this.appendChild(layout);
this.setClosable(true); North north = new North();
this.setBorder("normal"); layout.appendChild(north);
this.setWidth("1000px"); north.appendChild(grid);
Center center = new Center();
layout.appendChild(center);
center.setFlex(true);
Div div = new Div();
div.appendChild(contentPanel);
if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }

View File

@ -46,8 +46,14 @@ import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
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.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
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;
/** /**
* Based on InfoCashLine written by Jorg Janke * Based on InfoCashLine written by Jorg Janke
@ -84,6 +90,8 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener,
private Label lDateTo = new Label("-"); private Label lDateTo = new Label("-");
private Label lAmtFrom = new Label(Msg.translate(Env.getCtx(), "Amount")); private Label lAmtFrom = new Label(Msg.translate(Env.getCtx(), "Amount"));
private Label lAmtTo = new Label("-"); private Label lAmtTo = new Label("-");
private Borderlayout layout;
private Vbox southBody;
/** Array of Column Info */ /** Array of Column Info */
private static final ColumnInfo[] s_cashLayout = { private static final ColumnInfo[] s_cashLayout = {
@ -122,11 +130,24 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener,
* @param multiSelection multiple selections * @param multiSelection multiple selections
* @param whereClause where clause * @param whereClause where clause
*/ */
protected InfoCashLinePanel( int WindowNo, String value, protected InfoCashLinePanel( int WindowNo, String value,
boolean multiSelection, String whereClause) boolean multiSelection, String whereClause)
{ {
super (WindowNo, "cl", "C_CashLine_ID", multiSelection, whereClause); this(WindowNo, value, multiSelection, whereClause, true);
}
/**
* Detail Protected Constructor
*
* @param WindowNo window no
* @param value query value
* @param multiSelection multiple selections
* @param whereClause where clause
*/
protected InfoCashLinePanel( int WindowNo, String value,
boolean multiSelection, String whereClause, boolean lookup)
{
super (WindowNo, "cl", "C_CashLine_ID", multiSelection, whereClause, lookup);
log.info( "InfoCashLine"); log.info( "InfoCashLine");
setTitle(Msg.getMsg(Env.getCtx(), "InfoCashLine")); setTitle(Msg.getMsg(Env.getCtx(), "InfoCashLine"));
@ -227,20 +248,40 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener,
hbox.appendChild(fAmtTo); hbox.appendChild(fAmtTo);
row.appendChild(hbox); row.appendChild(hbox);
contentPanel.setWidth("99%"); layout = new Borderlayout();
contentPanel.setHeight("400px"); layout.setWidth("100%");
contentPanel.setVflex(true); layout.setHeight("100%");
if (!isLookup())
{
layout.setStyle("position: absolute");
}
this.appendChild(layout);
this.setWidth("850px"); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.appendChild(grid);
this.appendChild(new Separator()); Center center = new Center();
this.appendChild(contentPanel); layout.appendChild(center);
this.appendChild(new Separator()); center.setFlex(true);
this.appendChild(confirmPanel); Div div = new Div();
this.appendChild(new Separator()); div.appendChild(contentPanel);
this.appendChild(statusBar); if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -435,7 +476,13 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener,
public void tableChanged(WTableModelEvent event) public void tableChanged(WTableModelEvent event)
{ {
}
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
} }
} }

View File

@ -28,7 +28,6 @@ import java.util.logging.Level;
import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.GridFactory; import org.adempiere.webui.component.GridFactory;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel;
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.Textbox; import org.adempiere.webui.component.Textbox;
@ -42,7 +41,13 @@ import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox;
/** /**
* Zk Port * Zk Port
@ -73,6 +78,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener
/** list of query columns (SQL) */ /** list of query columns (SQL) */
private ArrayList<String> m_queryColumnsSql = new ArrayList<String>(); private ArrayList<String> m_queryColumnsSql = new ArrayList<String>();
private Borderlayout layout;
private Vbox southBody;
public InfoGeneralPanel(String queryValue, int windowNo,String tableName,String keyColumn, boolean isSOTrx, String whereClause) public InfoGeneralPanel(String queryValue, int windowNo,String tableName,String keyColumn, boolean isSOTrx, String whereClause)
{ {
@ -85,6 +92,11 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener
init(); init();
initComponents(); initComponents();
if (queryValue != null && queryValue.length() > 0)
{
txt1.setValue(queryValue);
}
p_loadedOK = initInfo (); p_loadedOK = initInfo ();
} }
catch (Exception e) catch (Exception e)
@ -124,23 +136,40 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener
row.appendChild(lbl4.rightAlign()); row.appendChild(lbl4.rightAlign());
row.appendChild(txt4); row.appendChild(txt4);
Panel mainPanel = new Panel(); layout = new Borderlayout();
mainPanel.setWidth("100%"); layout.setWidth("100%");
mainPanel.appendChild(grid); layout.setHeight("100%");
if (!isLookup())
{
layout.setStyle("position: absolute");
}
this.appendChild(layout);
mainPanel.appendChild(new Separator()); North north = new North();
mainPanel.appendChild(contentPanel); layout.appendChild(north);
mainPanel.appendChild(new Separator()); north.appendChild(grid);
mainPanel.appendChild(confirmPanel);
// Elaine 2008/12/15
mainPanel.appendChild(new Separator());
mainPanel.appendChild(statusBar);
//
this.appendChild(mainPanel); Center center = new Center();
this.setClosable(true); layout.appendChild(center);
this.setBorder("normal"); center.setFlex(true);
this.setWidth("900px"); Div div = new Div();
div.appendChild(contentPanel);
if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
private void init() private void init()
@ -154,10 +183,6 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener
lbl2 = new Label(); lbl2 = new Label();
lbl3 = new Label(); lbl3 = new Label();
lbl4 = new Label(); lbl4 = new Label();
contentPanel.setWidth("99%");
contentPanel.setHeight("400px");
contentPanel.setVflex(true);
} }
private boolean initInfo () private boolean initInfo ()
@ -437,7 +462,12 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener
public void tableChanged(WTableModelEvent event) public void tableChanged(WTableModelEvent event)
{ {
// TODO Auto-generated method stub }
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
} }
} }

View File

@ -46,8 +46,14 @@ import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
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.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
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;
/** /**
* Based on InfoInOut written by Jorg Janke * Based on InfoInOut written by Jorg Janke
@ -86,6 +92,10 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
private Label lDateFrom = new Label(Msg.translate(Env.getCtx(), "MovementDate")); private Label lDateFrom = new Label(Msg.translate(Env.getCtx(), "MovementDate"));
private Label lDateTo = new Label("-"); private Label lDateTo = new Label("-");
private Vbox southBody;
private Borderlayout layout;
/** Array of Column Info */ /** Array of Column Info */
private static final ColumnInfo[] s_invoiceLayout = { private static final ColumnInfo[] s_invoiceLayout = {
new ColumnInfo(" ", "i.M_InOut_ID", IDColumn.class), new ColumnInfo(" ", "i.M_InOut_ID", IDColumn.class),
@ -105,11 +115,24 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
* @param multiSelection multiple selections * @param multiSelection multiple selections
* @param whereClause where clause * @param whereClause where clause
*/ */
protected InfoInOutPanel( int WindowNo, String value, protected InfoInOutPanel( int WindowNo, String value,
boolean multiSelection, String whereClause) boolean multiSelection, String whereClause)
{ {
super (WindowNo, "i", "M_InOut_ID", multiSelection, whereClause); this(WindowNo, value, multiSelection, whereClause, true);
}
/**
* Detail Protected Constructor
*
* @param WindowNo window no
* @param value query value
* @param multiSelection multiple selections
* @param whereClause where clause
*/
protected InfoInOutPanel( int WindowNo, String value,
boolean multiSelection, String whereClause, boolean lookup)
{
super (WindowNo, "i", "M_InOut_ID", multiSelection, whereClause, lookup);
log.info( "InfoInOut"); log.info( "InfoInOut");
setTitle(Msg.getMsg(Env.getCtx(), "InfoInOut")); setTitle(Msg.getMsg(Env.getCtx(), "InfoInOut"));
@ -192,20 +215,40 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
row.appendChild(fPOReference); row.appendChild(fPOReference);
row.appendChild(new Label()); row.appendChild(new Label());
contentPanel.setWidth("99%"); layout = new Borderlayout();
contentPanel.setHeight("400px"); layout.setWidth("100%");
contentPanel.setVflex(true); layout.setHeight("100%");
if (!isLookup())
{
layout.setStyle("position: absolute");
}
this.appendChild(layout);
this.setWidth("850px"); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.appendChild(grid);
this.appendChild(new Separator()); Center center = new Center();
this.appendChild(contentPanel); layout.appendChild(center);
this.appendChild(new Separator()); center.setFlex(true);
this.appendChild(confirmPanel); Div div = new Div();
this.appendChild(new Separator()); div.appendChild(contentPanel);
this.appendChild(statusBar); if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -386,4 +429,10 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
{ {
} }
@Override
protected void insertPagingComponent() {
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
}
} }

View File

@ -30,7 +30,6 @@ import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.GridFactory; import org.adempiere.webui.component.GridFactory;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.NumberBox; import org.adempiere.webui.component.NumberBox;
import org.adempiere.webui.component.Panel;
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.Textbox; import org.adempiere.webui.component.Textbox;
@ -49,8 +48,14 @@ import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
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;
/** /**
* Search Invoice and return selection * Search Invoice and return selection
@ -80,7 +85,21 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
protected InfoInvoicePanel(int WindowNo, String value, protected InfoInvoicePanel(int WindowNo, String value,
boolean multiSelection, String whereClause) boolean multiSelection, String whereClause)
{ {
super ( WindowNo, "i", "C_Invoice_ID", multiSelection, whereClause); this(WindowNo, value, multiSelection, whereClause, true);
}
/**
* Detail protected constructor
* @param WindowNo window no
* @param value query value
* @param multiSelection multiple selection
* @param whereClause where clause
*
*/
protected InfoInvoicePanel(int WindowNo, String value,
boolean multiSelection, String whereClause, boolean lookup)
{
super ( WindowNo, "i", "C_Invoice_ID", multiSelection, whereClause, lookup);
setTitle(Msg.getMsg(Env.getCtx(), "InfoInvoice")); setTitle(Msg.getMsg(Env.getCtx(), "InfoInvoice"));
// //
@ -119,6 +138,8 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
private Checkbox isSoTrx; private Checkbox isSoTrx;
private Checkbox isPaid; private Checkbox isPaid;
private Borderlayout layout;
private Vbox southBody;
/** Array of Column Info */ /** Array of Column Info */
private static final ColumnInfo[] s_invoiceLayout = { private static final ColumnInfo[] s_invoiceLayout = {
@ -172,10 +193,6 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
editorOrder = new WSearchEditor(lookupOrder, Msg.translate( editorOrder = new WSearchEditor(lookupOrder, Msg.translate(
Env.getCtx(), "C_Order_ID"), "", false, false, true); Env.getCtx(), "C_Order_ID"), "", false, false, true);
editorOrder.addValueChangeListener(this); editorOrder.addValueChangeListener(this);
contentPanel.setWidth("99%");
contentPanel.setHeight("400px");
contentPanel.setVflex(true);
} }
private void init() private void init()
@ -225,20 +242,40 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
hbox.appendChild(amountTo); hbox.appendChild(amountTo);
row.appendChild(hbox); row.appendChild(hbox);
Panel mainPanel = new Panel(); layout = new Borderlayout();
mainPanel.setWidth("100%"); layout.setWidth("100%");
mainPanel.appendChild(grid); layout.setHeight("100%");
mainPanel.appendChild(new Separator()); if (!isLookup())
mainPanel.appendChild(contentPanel); {
mainPanel.appendChild(new Separator()); layout.setStyle("position: absolute");
mainPanel.appendChild(confirmPanel); }
mainPanel.appendChild(new Separator()); this.appendChild(layout);
mainPanel.appendChild(statusBar);
this.appendChild(mainPanel); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.setWidth("850px");
Center center = new Center();
layout.appendChild(center);
center.setFlex(true);
Div div = new Div();
div.appendChild(contentPanel);
if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -526,7 +563,8 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
} }
@Override @Override
protected void saveSelectionDetail() { protected void saveSelectionDetail()
{
// publish for Callout to read // publish for Callout to read
Integer ID = getSelectedRowKey(); Integer ID = getSelectedRowKey();
Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_Invoice_ID", ID == null ? "0" : ID.toString()); Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_Invoice_ID", ID == null ? "0" : ID.toString());
@ -544,4 +582,11 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener
else else
Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", String.valueOf(C_InvoicePaySchedule_ID)); Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", String.valueOf(C_InvoicePaySchedule_ID));
} }
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
}
} }

View File

@ -30,7 +30,6 @@ import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.GridFactory; import org.adempiere.webui.component.GridFactory;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.NumberBox; import org.adempiere.webui.component.NumberBox;
import org.adempiere.webui.component.Panel;
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.Textbox; import org.adempiere.webui.component.Textbox;
@ -48,8 +47,14 @@ import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
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;
/** /**
* Search Order info and return selection * Search Order info and return selection
@ -87,6 +92,8 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
private WSearchEditor editorBPartner; private WSearchEditor editorBPartner;
private Checkbox isSoTrx; private Checkbox isSoTrx;
private Borderlayout layout;
private Vbox southBody;
/** Array of Column Info */ /** Array of Column Info */
private static final ColumnInfo[] s_invoiceLayout = { private static final ColumnInfo[] s_invoiceLayout = {
@ -105,7 +112,13 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
protected InfoOrderPanel(int WindowNo, String value, protected InfoOrderPanel(int WindowNo, String value,
boolean multiSelection, String whereClause) boolean multiSelection, String whereClause)
{ {
super ( WindowNo, "o", "C_Order_ID", multiSelection, whereClause); this(WindowNo, value, multiSelection, whereClause, true);
}
protected InfoOrderPanel(int WindowNo, String value,
boolean multiSelection, String whereClause, boolean lookup)
{
super ( WindowNo, "o", "C_Order_ID", multiSelection, whereClause, lookup);
log.info( "InfoOrder"); log.info( "InfoOrder");
setTitle(Msg.getMsg(Env.getCtx(), "InfoOrder")); setTitle(Msg.getMsg(Env.getCtx(), "InfoOrder"));
// //
@ -160,9 +173,6 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
Env.getCtx(), "C_BPartner_ID"), "", true, false, true); Env.getCtx(), "C_BPartner_ID"), "", true, false, true);
editorBPartner.addValueChangeListener(this); editorBPartner.addValueChangeListener(this);
contentPanel.setWidth("99%");
contentPanel.setHeight("400px");
contentPanel.setVflex(true);
} }
public void init() public void init()
@ -212,20 +222,40 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
hbox.appendChild(amountTo); hbox.appendChild(amountTo);
row.appendChild(hbox); row.appendChild(hbox);
Panel mainPanel = new Panel(); layout = new Borderlayout();
mainPanel.setWidth("100%"); layout.setWidth("100%");
mainPanel.appendChild(grid); layout.setHeight("100%");
mainPanel.appendChild(new Separator()); if (!isLookup())
mainPanel.appendChild(contentPanel); {
mainPanel.appendChild(new Separator()); layout.setStyle("position: absolute");
mainPanel.appendChild(confirmPanel); }
mainPanel.appendChild(new Separator()); this.appendChild(layout);
mainPanel.appendChild(statusBar);
this.appendChild(mainPanel); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.setWidth("850px");
Center center = new Center();
layout.appendChild(center);
center.setFlex(true);
Div div = new Div();
div.appendChild(contentPanel);
if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -504,4 +534,10 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener
} }
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
}
} }

View File

@ -31,6 +31,7 @@ import java.util.Vector;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.apps.BusyDialog;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.ListModelTable; import org.adempiere.webui.component.ListModelTable;
import org.adempiere.webui.component.WListItemRenderer; import org.adempiere.webui.component.WListItemRenderer;
@ -40,6 +41,8 @@ import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.event.WTableModelEvent; import org.adempiere.webui.event.WTableModelEvent;
import org.adempiere.webui.event.WTableModelListener; import org.adempiere.webui.event.WTableModelListener;
import org.adempiere.webui.part.ITabOnSelectHandler;
import org.adempiere.webui.session.SessionManager;
import org.compiere.minigrid.ColumnInfo; import org.compiere.minigrid.ColumnInfo;
import org.compiere.minigrid.IDColumn; import org.compiere.minigrid.IDColumn;
import org.compiere.model.MRole; import org.compiere.model.MRole;
@ -49,10 +52,13 @@ import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.zkoss.zk.au.out.AuEcho;
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.zk.ui.util.Clients;
import org.zkoss.zul.ListModelExt; import org.zkoss.zul.ListModelExt;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.Paging; import org.zkoss.zul.Paging;
import org.zkoss.zul.event.ZulEvents; import org.zkoss.zul.event.ZulEvents;
@ -68,10 +74,11 @@ import org.zkoss.zul.event.ZulEvents;
*/ */
public abstract class InfoPanel extends Window implements EventListener, WTableModelListener, ListModelExt public abstract class InfoPanel extends Window implements EventListener, WTableModelListener, ListModelExt
{ {
/** /**
* * generated serial version ID
*/ */
private static final long serialVersionUID = 2961293943433626554L; private static final long serialVersionUID = 325050327514511004L;
private final static int PAGE_SIZE = 100; private final static int PAGE_SIZE = 100;
public static InfoPanel create (int WindowNo, public static InfoPanel create (int WindowNo,
@ -121,9 +128,9 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
*/ */
public static void showBPartner (int WindowNo) public static void showBPartner (int WindowNo)
{ {
InfoBPartnerPanel infoBPanel = new InfoBPartnerPanel ( "", WindowNo, InfoBPartnerPanel info = new InfoBPartnerPanel ( "", WindowNo,
!Env.getContext(Env.getCtx(),"IsSOTrx").equals("N"),false, ""); !Env.getContext(Env.getCtx(),"IsSOTrx").equals("N"),false, "", false);
AEnv.showWindow(infoBPanel); AEnv.showWindow(info);
} // showBPartner } // showBPartner
/** /**
@ -133,7 +140,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
*/ */
public static void showAsset (int WindowNo) public static void showAsset (int WindowNo)
{ {
InfoPanel info = new InfoAssetPanel (WindowNo, 0, "", false, ""); InfoPanel info = new InfoAssetPanel (WindowNo, 0, "", false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showBPartner } // showBPartner
@ -147,7 +154,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
InfoPanel info = new InfoProductPanel(WindowNo, InfoPanel info = new InfoProductPanel(WindowNo,
Env.getContextAsInt(Env.getCtx(), WindowNo, "M_Warehouse_ID"), Env.getContextAsInt(Env.getCtx(), WindowNo, "M_Warehouse_ID"),
Env.getContextAsInt(Env.getCtx(), WindowNo, "M_PriceList_ID"), Env.getContextAsInt(Env.getCtx(), WindowNo, "M_PriceList_ID"),
false, "", ""); false, "", "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showProduct } // showProduct
@ -159,7 +166,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
*/ */
public static void showOrder (int WindowNo, String value) public static void showOrder (int WindowNo, String value)
{ {
InfoPanel info = new InfoOrderPanel(WindowNo, "", false, ""); InfoPanel info = new InfoOrderPanel(WindowNo, "", false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showOrder } // showOrder
@ -171,7 +178,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
*/ */
public static void showInvoice (int WindowNo, String value) public static void showInvoice (int WindowNo, String value)
{ {
InfoPanel info = new InfoInvoicePanel(WindowNo, "", false, ""); InfoPanel info = new InfoInvoicePanel(WindowNo, "", false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showInvoice } // showInvoice
@ -184,7 +191,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
public static void showInOut (int WindowNo, String value) public static void showInOut (int WindowNo, String value)
{ {
InfoPanel info = new InfoInOutPanel (WindowNo, value, InfoPanel info = new InfoInOutPanel (WindowNo, value,
false, ""); false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showInOut } // showInOut
@ -197,7 +204,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
public static void showPayment (int WindowNo, String value) public static void showPayment (int WindowNo, String value)
{ {
InfoPanel info = new InfoPaymentPanel (WindowNo, value, InfoPanel info = new InfoPaymentPanel (WindowNo, value,
false, ""); false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showPayment } // showPayment
@ -210,7 +217,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
public static void showCashLine (int WindowNo, String value) public static void showCashLine (int WindowNo, String value)
{ {
InfoPanel info = new InfoCashLinePanel (WindowNo, value, InfoPanel info = new InfoCashLinePanel (WindowNo, value,
false, ""); false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showCashLine } // showCashLine
@ -223,12 +230,13 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
public static void showAssignment (int WindowNo, String value) public static void showAssignment (int WindowNo, String value)
{ {
InfoPanel info = new InfoAssignmentPanel (WindowNo, value, InfoPanel info = new InfoAssignmentPanel (WindowNo, value,
false, ""); false, "", false);
AEnv.showWindow(info); AEnv.showWindow(info);
} // showAssignment } // showAssignment
/** Window Width */ /** Window Width */
static final int INFO_WIDTH = 800; static final int INFO_WIDTH = 800;
private boolean m_lookup;
/************************************************** /**************************************************
* Detail Constructor * Detail Constructor
@ -241,12 +249,27 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
String tableName, String keyColumn,boolean multipleSelection, String tableName, String keyColumn,boolean multipleSelection,
String whereClause) String whereClause)
{ {
this(WindowNo, tableName, keyColumn, multipleSelection, whereClause, true);
}
/**************************************************
* Detail Constructor
* @param WindowNo WindowNo
* @param tableName tableName
* @param keyColumn keyColumn
* @param whereClause whereClause
*/
protected InfoPanel (int WindowNo,
String tableName, String keyColumn,boolean multipleSelection,
String whereClause, boolean lookup)
{
log.info("WinNo=" + p_WindowNo + " " + whereClause); log.info("WinNo=" + p_WindowNo + " " + whereClause);
p_WindowNo = WindowNo; p_WindowNo = WindowNo;
p_tableName = tableName; p_tableName = tableName;
p_keyColumn = keyColumn; p_keyColumn = keyColumn;
p_multipleSelection = multipleSelection; p_multipleSelection = multipleSelection;
m_lookup = lookup;
if (whereClause == null || whereClause.indexOf('@') == -1) if (whereClause == null || whereClause.indexOf('@') == -1)
p_whereClause = whereClause; p_whereClause = whereClause;
@ -258,10 +281,35 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
} }
init(); init();
this.setAttribute(ITabOnSelectHandler.ATTRIBUTE_KEY, new ITabOnSelectHandler() {
public void onSelect() {
scrollToSelectedRow();
}
});
} // InfoPanel } // InfoPanel
private void init() private void init()
{ {
if (isLookup())
{
setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
setBorder("normal");
setClosable(true);
int height = SessionManager.getAppDesktop().getClientInfo().desktopHeight * 85 / 100;
int width = SessionManager.getAppDesktop().getClientInfo().desktopWidth * 80 / 100;
setWidth(width + "px");
setHeight(height + "px");
this.setContentStyle("overflow: auto");
}
else
{
setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
setBorder("none");
setWidth("100%");
setHeight("100%");
setStyle("position: absolute");
}
confirmPanel = new ConfirmPanel(true, true, false, true, true, true); // Elaine 2008/12/16 confirmPanel = new ConfirmPanel(true, true, false, true, true, true); // Elaine 2008/12/16
confirmPanel.addActionListener(Events.ON_CLICK, this); confirmPanel.addActionListener(Events.ON_CLICK, this);
confirmPanel.setStyle("border-top: 2px groove #444; padding-top: 4px"); confirmPanel.setStyle("border-top: 2px groove #444; padding-top: 4px");
@ -271,6 +319,10 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
confirmPanel.getButton(ConfirmPanel.A_HISTORY).setVisible(hasHistory()); confirmPanel.getButton(ConfirmPanel.A_HISTORY).setVisible(hasHistory());
confirmPanel.getButton(ConfirmPanel.A_ZOOM).setVisible(hasZoom()); confirmPanel.getButton(ConfirmPanel.A_ZOOM).setVisible(hasZoom());
// //
if (!isLookup())
{
confirmPanel.getButton(ConfirmPanel.A_OK).setVisible(false);
}
this.setSizable(true); this.setSizable(true);
this.setMaximizable(true); this.setMaximizable(true);
@ -329,6 +381,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
private int cacheStart; private int cacheStart;
private int cacheEnd; private int cacheEnd;
private boolean m_useDatabasePaging = false; private boolean m_useDatabasePaging = false;
private BusyDialog progressWindow;
private static final String[] lISTENER_EVENTS = {}; private static final String[] lISTENER_EVENTS = {};
@ -349,7 +402,6 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
public void setStatusLine (String text, boolean error) public void setStatusLine (String text, boolean error)
{ {
statusBar.setStatusLine(text, error); statusBar.setStatusLine(text, error);
Thread.yield();
} // setStatusLine } // setStatusLine
/** /**
@ -367,7 +419,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
String orderBy) String orderBy)
{ {
String sql =contentPanel.prepareTable(layout, from, String sql =contentPanel.prepareTable(layout, from,
where,p_multipleSelection, where,p_multipleSelection && !m_lookup,
getTableName(),false); getTableName(),false);
p_layout = contentPanel.getLayout(); p_layout = contentPanel.getLayout();
m_sqlMain = sql; m_sqlMain = sql;
@ -377,14 +429,6 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
m_sqlUserOrder = ""; m_sqlUserOrder = "";
if (orderBy != null && orderBy.length() > 0) if (orderBy != null && orderBy.length() > 0)
m_sqlOrder = " ORDER BY " + orderBy; m_sqlOrder = " ORDER BY " + orderBy;
int p = from.indexOf(" ");
String tableName = p > 0 ? from.substring(0, p) : from;
MTable table = MTable.get(Env.getCtx(), tableName);
if (table != null)
{
m_useDatabasePaging = table.isHighVolume();
}
} // prepareTable } // prepareTable
@ -397,9 +441,10 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
cacheStart = -1; cacheStart = -1;
cacheEnd = -1; cacheEnd = -1;
testCount();
m_useDatabasePaging = (m_count > 1000);
if (m_useDatabasePaging) if (m_useDatabasePaging)
{ {
testCount();
return ; return ;
} }
else else
@ -507,12 +552,6 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
} }
} }
if (!testCount())
{
line = new ArrayList<Object>();
return line;
}
cacheStart = start + 1 - (PAGE_SIZE * 4); cacheStart = start + 1 - (PAGE_SIZE * 4);
if (cacheStart <= 0) if (cacheStart <= 0)
cacheStart = 1; cacheStart = 1;
@ -557,6 +596,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
m_pstmt = DB.prepareStatement(dataSql, null); m_pstmt = DB.prepareStatement(dataSql, null);
setParameters (m_pstmt, false); // no count setParameters (m_pstmt, false); // no count
log.fine("Start query - " + (System.currentTimeMillis()-startTime) + "ms"); log.fine("Start query - " + (System.currentTimeMillis()-startTime) + "ms");
m_pstmt.setFetchSize(100);
m_rs = m_pstmt.executeQuery(); m_rs = m_pstmt.executeQuery();
log.fine("End query - " + (System.currentTimeMillis()-startTime) + "ms"); log.fine("End query - " + (System.currentTimeMillis()-startTime) + "ms");
//skips the row that we dont need if we can't use native db paging //skips the row that we dont need if we can't use native db paging
@ -710,7 +750,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
*/ */
protected Integer getSelectedRowKey() protected Integer getSelectedRowKey()
{ {
int key = contentPanel.getSelectedRowKey(); Integer key = contentPanel.getSelectedRowKey();
return key; return key;
} // getSelectedRowKey } // getSelectedRowKey
@ -988,12 +1028,12 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
} }
else if (event.getTarget() == contentPanel && event.getName().equals(Events.ON_DOUBLE_CLICK)) else if (event.getTarget() == contentPanel && event.getName().equals(Events.ON_DOUBLE_CLICK))
{ {
onOk(); onDoubleClick();
} }
else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_REFRESH))) else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_REFRESH)))
{ {
executeQuery(); showBusyDialog();
renderItems(); Clients.response(new AuEcho(this, "onQueryCallback", null));
} }
else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_CANCEL))) else if (event.getTarget().equals(confirmPanel.getButton(ConfirmPanel.A_CANCEL)))
{ {
@ -1021,6 +1061,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
if (!contentPanel.getChildren().isEmpty() && contentPanel.getSelectedRowKey()!=null) if (!contentPanel.getChildren().isEmpty() && contentPanel.getSelectedRowKey()!=null)
{ {
zoom(); zoom();
if (isLookup())
this.detach(); this.detach();
} }
} }
@ -1047,12 +1088,36 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
//default //default
else else
{ {
executeQuery(); showBusyDialog();
renderItems(); Clients.response(new AuEcho(this, "onQueryCallback", null));
} }
} }
} // onEvent } // onEvent
private void showBusyDialog() {
progressWindow = new BusyDialog();
progressWindow.setPage(this.getPage());
progressWindow.doHighlighted();
}
private void hideBusyDialog() {
progressWindow.dispose();
progressWindow = null;
}
public void onQueryCallback()
{
try
{
executeQuery();
renderItems();
}
finally
{
hideBusyDialog();
}
}
private void onOk() private void onOk()
{ {
if (!contentPanel.getChildren().isEmpty() && contentPanel.getSelectedRowKey()!=null) if (!contentPanel.getChildren().isEmpty() && contentPanel.getSelectedRowKey()!=null)
@ -1061,6 +1126,19 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
} }
} }
private void onDoubleClick()
{
if (isLookup())
{
dispose(true);
}
else
{
zoom();
}
}
public void tableChanged(WTableModelEvent event) public void tableChanged(WTableModelEvent event)
{ {
enableButtons(); enableButtons();
@ -1076,7 +1154,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
} }
else else
{ {
int recordId = contentPanel.getSelectedRowKey(); Integer recordId = contentPanel.getSelectedRowKey();
int AD_Table_ID = MTable.getTable_ID(p_tableName); int AD_Table_ID = MTable.getTable_ID(p_tableName);
if (AD_Table_ID <= 0) if (AD_Table_ID <= 0)
{ {
@ -1117,7 +1195,13 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
m_ok = ok; m_ok = ok;
// End Worker // End Worker
if (isLookup())
{
saveSelection(); saveSelection();
}
if (Window.MODE_EMBEDDED.equals(getAttribute(Window.MODE_KEY)))
SessionManager.getAppDesktop().closeActiveWindow();
else
this.detach(); this.detach();
} // dispose } // dispose
@ -1179,5 +1263,18 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
} }
} }
public boolean isLookup()
{
return m_lookup;
}
public void scrollToSelectedRow()
{
if (contentPanel != null && contentPanel.getSelectedIndex() >= 0) {
Listitem selected = contentPanel.getItemAtIndex(contentPanel.getSelectedIndex());
if (selected != null) {
selected.focus();
}
}
}
} // Info } // Info

View File

@ -47,8 +47,14 @@ import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
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.zkex.zul.Borderlayout;
import org.zkoss.zkex.zul.Center;
import org.zkoss.zkex.zul.North;
import org.zkoss.zkex.zul.South;
import org.zkoss.zul.Div;
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;
/** /**
* Based on InfoPayment written by Jorg Janke * Based on InfoPayment written by Jorg Janke
@ -83,6 +89,8 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
private Label lDateTo = new Label("-"); private Label lDateTo = new Label("-");
private Label lAmtFrom = new Label(Msg.translate(Env.getCtx(), "PayAmt")); private Label lAmtFrom = new Label(Msg.translate(Env.getCtx(), "PayAmt"));
private Label lAmtTo = new Label("-"); private Label lAmtTo = new Label("-");
private Borderlayout layout;
private Vbox southBody;
/** Array of Column Info */ /** Array of Column Info */
private static final ColumnInfo[] s_paymentLayout = { private static final ColumnInfo[] s_paymentLayout = {
@ -120,11 +128,25 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
* @param multiSelection multiple selections * @param multiSelection multiple selections
* @param whereClause where clause * @param whereClause where clause
*/ */
protected InfoPaymentPanel(int WindowNo, String value, protected InfoPaymentPanel(int WindowNo, String value,
boolean multiSelection, String whereClause) boolean multiSelection, String whereClause)
{ {
super(WindowNo, "p", "C_Payment_ID", multiSelection, whereClause); this(WindowNo, value, multiSelection, whereClause, true);
}
/**
* Detail Protected Constructor
*
* @param modal modal
* @param WindowNo window no
* @param value query value
* @param multiSelection multiple selections
* @param whereClause where clause
*/
protected InfoPaymentPanel(int WindowNo, String value,
boolean multiSelection, String whereClause, boolean lookup)
{
super(WindowNo, "p", "C_Payment_ID", multiSelection, whereClause, lookup);
log.info( "InfoPaymentPanel"); log.info( "InfoPaymentPanel");
setTitle(Msg.getMsg(Env.getCtx(), "InfoPayment")); setTitle(Msg.getMsg(Env.getCtx(), "InfoPayment"));
@ -208,20 +230,40 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
hbox.appendChild(fAmtTo); hbox.appendChild(fAmtTo);
row.appendChild(hbox); row.appendChild(hbox);
contentPanel.setWidth("99%"); layout = new Borderlayout();
contentPanel.setHeight("400px"); layout.setWidth("100%");
contentPanel.setVflex(true); layout.setHeight("100%");
if (!isLookup())
{
layout.setStyle("position: absolute");
}
this.appendChild(layout);
this.setWidth("850px"); North north = new North();
this.setClosable(true); layout.appendChild(north);
this.setBorder("normal"); north.appendChild(grid);
this.appendChild(grid);
this.appendChild(new Separator()); Center center = new Center();
this.appendChild(contentPanel); layout.appendChild(center);
this.appendChild(new Separator()); center.setFlex(true);
this.appendChild(confirmPanel); Div div = new Div();
this.appendChild(new Separator()); div.appendChild(contentPanel);
this.appendChild(statusBar); if (isLookup())
contentPanel.setWidth("99%");
else
contentPanel.setStyle("width: 99%; margin: 0px auto;");
contentPanel.setVflex(true);
div.setStyle("width :100%; height: 100%");
center.appendChild(div);
South south = new South();
layout.appendChild(south);
southBody = new Vbox();
southBody.setWidth("100%");
south.appendChild(southBody);
southBody.appendChild(confirmPanel);
southBody.appendChild(new Separator());
southBody.appendChild(statusBar);
} }
/** /**
@ -418,8 +460,15 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
} }
} }
public void tableChanged(WTableModelEvent event) { public void tableChanged(WTableModelEvent event)
{
}
@Override
protected void insertPagingComponent()
{
southBody.insertBefore(paging, southBody.getFirstChild());
layout.invalidate();
} }
} }

View File

@ -173,7 +173,22 @@ public class InfoProductPanel extends InfoPanel implements EventListener
int M_Warehouse_ID, int M_PriceList_ID, boolean multipleSelection,String value, int M_Warehouse_ID, int M_PriceList_ID, boolean multipleSelection,String value,
String whereClause) String whereClause)
{ {
super (windowNo, "p", "M_Product_ID",multipleSelection, whereClause); this(windowNo, M_Warehouse_ID, M_PriceList_ID, multipleSelection, value, whereClause, true);
}
/**
* Standard Constructor
* @param WindowNo window no
* @param M_Warehouse_ID warehouse
* @param M_PriceList_ID price list
* @param value Query Value or Name if enclosed in @
* @param whereClause where clause
*/
public InfoProductPanel(int windowNo,
int M_Warehouse_ID, int M_PriceList_ID, boolean multipleSelection,String value,
String whereClause, boolean lookup)
{
super (windowNo, "p", "M_Product_ID",multipleSelection, whereClause, lookup);
log.info(value + ", Wh=" + M_Warehouse_ID + ", PL=" + M_PriceList_ID + ", WHERE=" + whereClause); log.info(value + ", Wh=" + M_Warehouse_ID + ", PL=" + M_PriceList_ID + ", WHERE=" + whereClause);
setTitle(Msg.getMsg(Env.getCtx(), "InfoProduct")); setTitle(Msg.getMsg(Env.getCtx(), "InfoProduct"));
// //
@ -272,7 +287,6 @@ public class InfoProductPanel extends InfoPanel implements EventListener
fieldVendor = new Textbox(); fieldVendor = new Textbox();
fieldVendor.setMaxlength(40); fieldVendor.setMaxlength(40);
contentPanel.setWidth("99%");
contentPanel.setVflex(true); contentPanel.setVflex(true);
} // initComponents } // initComponents
@ -313,6 +327,12 @@ public class InfoProductPanel extends InfoPanel implements EventListener
row.appendChild(lblAS.rightAlign()); row.appendChild(lblAS.rightAlign());
row.appendChild(pickAS); row.appendChild(pickAS);
row = new Row();
rows.appendChild(row);
row.appendChild(statusBar);
row.setSpans("6");
statusBar.setEastVisibility(false);
// Product Attribute Instance // Product Attribute Instance
m_PAttributeButton = confirmPanel.createButton(ConfirmPanel.A_PATTRIBUTE); m_PAttributeButton = confirmPanel.createButton(ConfirmPanel.A_PATTRIBUTE);
confirmPanel.addComponentsLeft(m_PAttributeButton); confirmPanel.addComponentsLeft(m_PAttributeButton);
@ -426,7 +446,10 @@ public class InfoProductPanel extends InfoPanel implements EventListener
borderlayout.setWidth("100%"); borderlayout.setWidth("100%");
borderlayout.setHeight("100%"); borderlayout.setHeight("100%");
if (isLookup())
borderlayout.setStyle("border: none; position: relative"); borderlayout.setStyle("border: none; position: relative");
else
borderlayout.setStyle("border: none; position: absolute");
Center center = new Center(); Center center = new Center();
center.setAutoscroll(true); center.setAutoscroll(true);
center.setFlex(true); center.setFlex(true);
@ -455,13 +478,17 @@ public class InfoProductPanel extends InfoPanel implements EventListener
south = new South(); south = new South();
mainPanel.appendChild(south); mainPanel.appendChild(south);
south.appendChild(confirmPanel); south.appendChild(confirmPanel);
if (!isLookup())
{
mainPanel.setStyle("position: absolute");
}
this.appendChild(mainPanel); this.appendChild(mainPanel);
this.setClosable(true); if (isLookup())
this.setBorder("normal"); {
this.setWidth(width + "px"); this.setWidth(width + "px");
this.setHeight(height + "px"); this.setHeight(height + "px");
}
contentPanel.addActionListener(new EventListener() { contentPanel.addActionListener(new EventListener() {
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {

View File

@ -316,5 +316,11 @@ public class StatusBarPanel extends Panel implements EventListener, IStatusBar
popup.detach(); popup.detach();
} }
/**
* @param visible
*/
public void setEastVisibility(boolean visible) {
east.setVisible(visible);
}
} }