Minor info product window search enhancement.

This commit is contained in:
Heng Sin Low 2010-11-23 18:34:00 +08:00
parent b9e40c4bf4
commit 5832e19b79
2 changed files with 17 additions and 15 deletions

View File

@ -356,7 +356,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
protected WListbox contentPanel = new WListbox(); protected WListbox contentPanel = new WListbox();
protected Paging paging; protected Paging paging;
protected int pageNo; protected int pageNo;
private int m_count; protected int m_count;
private int cacheStart; private int cacheStart;
private int cacheEnd; private int cacheEnd;
private boolean m_useDatabasePaging = false; private boolean m_useDatabasePaging = false;
@ -656,7 +656,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
* Test Row Count * Test Row Count
* @return true if display * @return true if display
*/ */
private boolean testCount() protected boolean testCount()
{ {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
String dynWhere = getSQLWhere(); String dynWhere = getSQLWhere();

View File

@ -95,7 +95,7 @@ import org.zkoss.zkex.zul.South;
public class InfoProductPanel extends InfoPanel implements EventListener public class InfoProductPanel extends InfoPanel implements EventListener
{ {
/** /**
* *
*/ */
private static final long serialVersionUID = 6804975825156657866L; private static final long serialVersionUID = 6804975825156657866L;
private Label lblValue = new Label(); private Label lblValue = new Label();
@ -194,7 +194,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener
// //
initComponents(); initComponents();
init(); init();
initInfo (value, M_Warehouse_ID, M_PriceList_ID); initInfo (M_Warehouse_ID, M_PriceList_ID);
m_C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), windowNo, "C_BPartner_ID"); m_C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), windowNo, "C_BPartner_ID");
int no = contentPanel.getRowCount(); int no = contentPanel.getRowCount();
@ -203,6 +203,14 @@ public class InfoProductPanel extends InfoPanel implements EventListener
// AutoQuery // AutoQuery
if (value != null && value.length() > 0) if (value != null && value.length() > 0)
{ {
// Set Value or Name
fieldValue.setText(value);
testCount();
if (m_count <= 0) {
fieldValue.setText("");
fieldName.setValue(value);
}
executeQuery(); executeQuery();
renderItems(); renderItems();
} }
@ -326,13 +334,13 @@ public class InfoProductPanel extends InfoPanel implements EventListener
row.appendChild(pickProductCategory); row.appendChild(pickProductCategory);
row.appendChild(lblAS.rightAlign()); row.appendChild(lblAS.rightAlign());
row.appendChild(pickAS); row.appendChild(pickAS);
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
row.appendChild(statusBar); row.appendChild(statusBar);
row.setSpans("6"); row.setSpans("6");
statusBar.setEastVisibility(false); 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);
@ -609,20 +617,14 @@ public class InfoProductPanel extends InfoPanel implements EventListener
/** /**
* Dynamic Init * Dynamic Init
* *
* @param value value
* @param M_Warehouse_ID warehouse * @param M_Warehouse_ID warehouse
* @param M_PriceList_ID price list * @param M_PriceList_ID price list
*/ */
private void initInfo (String value, int M_Warehouse_ID, int M_PriceList_ID) private void initInfo (int M_Warehouse_ID, int M_PriceList_ID)
{ {
// Pick init // Pick init
fillPicks(M_PriceList_ID); fillPicks(M_PriceList_ID);
int M_PriceList_Version_ID = findPLV (M_PriceList_ID); int M_PriceList_Version_ID = findPLV (M_PriceList_ID);
// Set Value or Name
if (value.startsWith("@") && value.endsWith("@"))
fieldName.setText(value.substring(1,value.length()-1));
else
fieldValue.setText(value);
// Set Warehouse // Set Warehouse
if (M_Warehouse_ID == 0) if (M_Warehouse_ID == 0)
M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"); M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID");
@ -1450,7 +1452,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener
return M_Product_Category_ID; return M_Product_Category_ID;
} }
// //
public int getM_AttributeSet_ID() public int getM_AttributeSet_ID()
{ {
int M_AttributeSet_ID = 0; int M_AttributeSet_ID = 0;
@ -1461,5 +1463,5 @@ public class InfoProductPanel extends InfoPanel implements EventListener
return M_AttributeSet_ID; return M_AttributeSet_ID;
} }
} // InfoProduct } // InfoProduct