diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/DatetimeBox.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/DatetimeBox.java index ef1005b820..8288d1b28d 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/DatetimeBox.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/DatetimeBox.java @@ -15,6 +15,7 @@ package org.adempiere.webui.component; import java.text.SimpleDateFormat; import java.util.Date; +import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.apps.AEnv; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zul.Timebox; @@ -39,9 +40,10 @@ public class DatetimeBox extends Panel { } private void initComponents() { - dateBox.setStyle("display: inline"); - timeBox.setStyle("display: inline"); + dateBox.setStyle("display: inline;"); + timeBox.setStyle("display: inline;"); timeBox.setButtonVisible(false); + timeBox.setZclass(dateBox.getZclass()); String style = AEnv.isFirefox2() ? "display: inline" : "display: inline-block"; style = style + ";white-space:nowrap"; @@ -97,8 +99,8 @@ public class DatetimeBox extends Panel { * @param readWrite */ public void setEnabled(boolean readWrite) { - dateBox.setDisabled(!readWrite); - timeBox.setDisabled(!readWrite); + dateBox.setReadonly(!readWrite); + timeBox.setReadonly(!readWrite); dateBox.setButtonVisible(readWrite); } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index 50298485c8..7a3dfb4705 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -147,23 +147,24 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value { columnName = this.getColumnName(); - popupMenu = new WEditorPopupMenu(true, true, true, true); - - (getComponent().getTextBox()).setContext(popupMenu.getId()); -// getComponent().setContext(popupMenu.getId()); - + if (columnName.equals("C_BPartner_ID")) { + popupMenu = new WEditorPopupMenu(true, true, true, true); getComponent().setButtonImage("/images/BPartner10.png"); } else if (columnName.equals("M_Product_ID")) { + popupMenu = new WEditorPopupMenu(true, true, true, false); getComponent().setButtonImage("/images/Product10.png"); } else { + popupMenu = new WEditorPopupMenu(true, true, true, false); getComponent().setButtonImage("/images/PickOpen10.png"); } + + (getComponent().getTextBox()).setContext(popupMenu.getId()); return; } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java index eee273e0ef..fc692f7b0f 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java @@ -233,7 +233,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * @return WHERE clause */ - String getSQLWhere() + protected String getSQLWhere() { StringBuffer sql = new StringBuffer(); @@ -283,7 +283,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * @throws SQLException */ - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; @@ -337,7 +337,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * Show History */ - void showHistory() + protected void showHistory() { log.info( "InfoAsset.showHistory"); } // showHistory @@ -347,7 +347,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * @return true */ - boolean hasHistory() + protected boolean hasHistory() { return false; } // hasHistory @@ -377,7 +377,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * @return true */ - boolean hasZoom() + protected boolean hasZoom() { return true; } // hasZoom @@ -386,7 +386,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * Customize */ - void customize() + protected void customize() { log.info( "InfoAsset.customize"); } // customize @@ -396,7 +396,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev * @return false */ - boolean hasCustomize() + protected boolean hasCustomize() { return false; // for now } // hasCustomize diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssignmentPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssignmentPanel.java index 0ae794435b..d9efcb9cfb 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssignmentPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssignmentPanel.java @@ -256,7 +256,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * @return WHERE clause */ - String getSQLWhere() + protected String getSQLWhere() { StringBuffer sql = new StringBuffer(); @@ -293,7 +293,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * @throws SQLException */ - void setParameters (PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters (PreparedStatement pstmt, boolean forCount) throws SQLException { } @@ -302,7 +302,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * To be overwritten by concrete classes */ - void showHistory() + protected void showHistory() { } @@ -312,7 +312,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * @return true if it has history (default false) */ - boolean hasHistory() + protected boolean hasHistory() { return false; } @@ -322,7 +322,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * To be overwritten by concrete classes */ - void customize() + protected void customize() { } @@ -332,7 +332,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * @return true if it has customize (default false) */ - boolean hasCustomize() + protected boolean hasCustomize() { return false; } @@ -365,7 +365,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * @return true if it has zoom (default false) */ - boolean hasZoom() + protected boolean hasZoom() { return true; } @@ -375,7 +375,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener, Val * To be overwritten by concrete classes */ - void saveSelectionDetail() + protected void saveSelectionDetail() { } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java index 68f5cf744c..9eb2f1852f 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java @@ -480,8 +480,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl int C_BPartner_Location_ID = 0; - AD_User_ID = ((KeyNamePair)contentPanel.getValueAt(contentPanel.getSelectedIndex(), 3)).getKey(); - //AD_User_ID = contentPanel.getSelectedRowKey(); + AD_User_ID = ((KeyNamePair)contentPanel.getValueAt(row, 3)).getKey(); if (m_C_BPartner_Location_ID_index != -1) { diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java index 019a8164c4..ec7c9944e4 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java @@ -314,7 +314,7 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, * @return sql where clause */ - String getSQLWhere() + protected String getSQLWhere() { StringBuffer sql = new StringBuffer(); @@ -382,7 +382,7 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, * @throws SQLException */ - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; if (fName.getText().length() > 0) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index ef0027af8e..d312a5b415 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -391,7 +391,7 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener } @Override - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java index 412cca31dc..038283407c 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java @@ -277,7 +277,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev * @return where clause */ - String getSQLWhere() + protected String getSQLWhere() { StringBuffer sql = new StringBuffer(); @@ -322,7 +322,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev * @throws SQLException */ - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; @@ -387,7 +387,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev * @return true */ - boolean hasZoom() + protected boolean hasZoom() { return true; } // hasZoom diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java index 5da683357a..f782674602 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java @@ -395,7 +395,7 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener } @Override - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; if (txtDocumentNo.getText().length() > 0) @@ -541,4 +541,26 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener } } + @Override + protected void saveSelectionDetail() { + // publish for Callout to read + Integer ID = getSelectedRowKey(); + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_Invoice_ID", ID == null ? "0" : ID.toString()); + // + int C_InvoicePaySchedule_ID = 0; + int row = contentPanel.getSelectedRow(); + if (row >= 0) + { + Object value = contentPanel.getValueAt(row, INDEX_PAYSCHEDULE); + if (value != null && value instanceof KeyNamePair) + C_InvoicePaySchedule_ID = ((KeyNamePair)value).getKey(); + } + if (C_InvoicePaySchedule_ID <= 0) // not selected + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", "0"); + else + Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_InvoicePaySchedule_ID", String.valueOf(C_InvoicePaySchedule_ID)); + } + + + } diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java index 20a97e09ea..258a4f3390 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java @@ -43,7 +43,6 @@ import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; import org.zkoss.zk.ui.WrongValueException; -import org.zkoss.zul.Div; import org.zkoss.zul.Hbox; import org.zkoss.zul.Separator; import org.zkoss.zul.Vbox; @@ -356,7 +355,7 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener } @Override - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; if (txtDocumentNo.getText().length() > 0) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java index c11028997b..bcd4f6b9c4 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPanel.java @@ -680,7 +680,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM * Get Table name Synonym * @return table name */ - String getTableName() + protected String getTableName() { return p_tableName; } // getTableName @@ -689,7 +689,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM * Get Key Column Name * @return column name */ - String getKeyColumn() + protected String getKeyColumn() { return p_keyColumn; } // getKeyColumn @@ -705,7 +705,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM * To be overwritten by concrete classes * @return WHERE clause */ - abstract String getSQLWhere(); + protected abstract String getSQLWhere(); /** * Set Parameters for Query @@ -714,7 +714,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM * @param forCount for counting records * @throws SQLException */ - abstract void setParameters (PreparedStatement pstmt, boolean forCount) + protected abstract void setParameters (PreparedStatement pstmt, boolean forCount) throws SQLException; /** * notify to search editor of a value change in the selection info @@ -722,35 +722,35 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM * */ - void showHistory() {} + protected void showHistory() {} /** * Has History (false) * To be overwritten by concrete classes * @return true if it has history (default false) */ - boolean hasHistory() {return false;} + protected boolean hasHistory() {return false;} /** * Customize dialog * To be overwritten by concrete classes */ - void customize() {} + protected void customize() {} /** * Has Customize (false) * To be overwritten by concrete classes * @return true if it has customize (default false) */ - boolean hasCustomize() {return false;} + protected boolean hasCustomize() {return false;} /** * Has Zoom (false) * To be overwritten by concrete classes * @return true if it has zoom (default false) */ - boolean hasZoom() {return false;} + protected boolean hasZoom() {return false;} /** * Save Selection Details * To be overwritten by concrete classes */ - void saveSelectionDetail() {} + protected void saveSelectionDetail() {} /** * Get Zoom Window diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java index 9de9a84497..6c91a13f76 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java @@ -294,7 +294,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, * @return sql where clause */ - String getSQLWhere() + protected String getSQLWhere() { StringBuffer sql = new StringBuffer(); @@ -347,7 +347,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, * @throws SQLException */ - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; @@ -442,7 +442,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, * @return true */ - boolean hasZoom() + protected boolean hasZoom() { return true; } // hasZoom diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java index 3a9f5c40b4..250c00f21b 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java @@ -543,7 +543,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener * @param forCount for counting records * @throws SQLException */ - void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException + protected void setParameters(PreparedStatement pstmt, boolean forCount) throws SQLException { int index = 1; @@ -651,7 +651,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener /** * Show History */ - void showHistory() + protected void showHistory() { /*log.info(""); Integer M_Product_ID = getSelectedRowKey(); @@ -674,7 +674,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener * * @return true (has history) */ - boolean hasHistory() + protected boolean hasHistory() { return true; } // hasHistory @@ -683,7 +683,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener * Has Zoom * @return (has zoom) */ - boolean hasZoom() + protected boolean hasZoom() { return true; } // hasZoom @@ -691,7 +691,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener /** * Customize */ - void customize() + protected void customize() { log.info(""); } // customize @@ -700,7 +700,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener * Has Customize * @return false (no customize) */ - boolean hasCustomize() + protected boolean hasCustomize() { return false; // for now } // hasCustomize @@ -708,7 +708,7 @@ public final class InfoProductPanel extends InfoPanel implements EventListener /** * Save Selection Settings for PriceList */ - void saveSelectionDetail() + protected void saveSelectionDetail() { // publish for Callout to read Integer ID = getSelectedRowKey();