IDEMPIERE-318 null.pointer.exception in Info Product

This commit is contained in:
Heng Sin Low 2012-06-23 09:22:31 +08:00
parent 133c0450ae
commit 6b5be8ce33
2 changed files with 13 additions and 11 deletions

View File

@ -309,6 +309,7 @@ public abstract class InfoPanel extends Window implements EventListener, WTableM
this.addEventListener(Events.ON_OK, this); this.addEventListener(Events.ON_OK, this);
contentPanel.setOddRowSclass(null); contentPanel.setOddRowSclass(null);
contentPanel.setSizedByContent(true);
} // init } // init
protected ConfirmPanel confirmPanel; protected ConfirmPanel confirmPanel;
/** Master (owning) Window */ /** Master (owning) Window */

View File

@ -39,7 +39,6 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.Vector; import java.util.Vector;
import java.util.logging.Level; import java.util.logging.Level;
@ -269,7 +268,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener
pickPriceList.setRows(0); pickPriceList.setRows(0);
pickPriceList.setMultiple(false); pickPriceList.setMultiple(false);
pickPriceList.setMold("select"); pickPriceList.setMold("select");
pickPriceList.setWidth("150px"); pickPriceList.setHflex("1");
pickPriceList.addEventListener(Events.ON_SELECT, this); pickPriceList.addEventListener(Events.ON_SELECT, this);
// Elaine 2008/11/21 // Elaine 2008/11/21
@ -277,24 +276,24 @@ public class InfoProductPanel extends InfoPanel implements EventListener
pickProductCategory.setRows(0); pickProductCategory.setRows(0);
pickProductCategory.setMultiple(false); pickProductCategory.setMultiple(false);
pickProductCategory.setMold("select"); pickProductCategory.setMold("select");
pickProductCategory.setWidth("150px"); pickProductCategory.setHflex("1");
pickProductCategory.addEventListener(Events.ON_SELECT, this); pickProductCategory.addEventListener(Events.ON_SELECT, this);
// //
pickAS = new Listbox(); pickAS = new Listbox();
pickAS.setRows(0); pickAS.setRows(0);
pickAS.setMultiple(false); pickAS.setMultiple(false);
pickAS.setMold("select"); pickAS.setMold("select");
pickAS.setWidth("150px"); pickAS.setHflex("1");
pickAS.addEventListener(Events.ON_SELECT, this); pickAS.addEventListener(Events.ON_SELECT, this);
pickWarehouse = new Listbox(); pickWarehouse = new Listbox();
pickWarehouse.setRows(0); pickWarehouse.setRows(0);
pickWarehouse.setMultiple(false); pickWarehouse.setMultiple(false);
pickWarehouse.setMold("select"); pickWarehouse.setMold("select");
pickWarehouse.setWidth("150px"); pickWarehouse.setHflex("1");
pickWarehouse.addEventListener(Events.ON_SELECT, this); pickWarehouse.addEventListener(Events.ON_SELECT, this);
fieldVendor = new Textbox(); fieldVendor = new Textbox();
contentPanel.setVflex(true); contentPanel.setVflex(true);
} // initComponents } // initComponents
@ -310,8 +309,10 @@ public class InfoProductPanel extends InfoPanel implements EventListener
rows.appendChild(row); rows.appendChild(row);
row.appendChild(lblValue.rightAlign()); row.appendChild(lblValue.rightAlign());
row.appendChild(fieldValue); row.appendChild(fieldValue);
fieldValue.setHflex("1");
row.appendChild(lblUPC.rightAlign()); row.appendChild(lblUPC.rightAlign());
row.appendChild(fieldUPC); row.appendChild(fieldUPC);
fieldUPC.setHflex("1");
row.appendChild(lblWarehouse.rightAlign()); row.appendChild(lblWarehouse.rightAlign());
row.appendChild(pickWarehouse); row.appendChild(pickWarehouse);
row.appendChild(m_InfoPAttributeButton); row.appendChild(m_InfoPAttributeButton);
@ -321,10 +322,13 @@ public class InfoProductPanel extends InfoPanel implements EventListener
rows.appendChild(row); rows.appendChild(row);
row.appendChild(lblName.rightAlign()); row.appendChild(lblName.rightAlign());
row.appendChild(fieldName); row.appendChild(fieldName);
fieldName.setHflex("1");
row.appendChild(lblSKU.rightAlign()); row.appendChild(lblSKU.rightAlign());
row.appendChild(fieldSKU); row.appendChild(fieldSKU);
fieldSKU.setHflex("1");
row.appendChild(lblVendor.rightAlign()); row.appendChild(lblVendor.rightAlign());
row.appendChild(fieldVendor); row.appendChild(fieldVendor);
fieldVendor.setHflex("1");
// //
row = new Row(); row = new Row();
@ -341,6 +345,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener
row.appendChild(statusBar); row.appendChild(statusBar);
row.setSpans("6"); row.setSpans("6");
statusBar.setEastVisibility(false); statusBar.setEastVisibility(false);
statusBar.setWidth("100%");
// Product Attribute Instance // Product Attribute Instance
m_PAttributeButton = confirmPanel.createButton(ConfirmPanel.A_PATTRIBUTE); m_PAttributeButton = confirmPanel.createButton(ConfirmPanel.A_PATTRIBUTE);
@ -351,6 +356,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener
// Elaine 2008/11/25 // Elaine 2008/11/25
fieldDescription.setMultiline(true); fieldDescription.setMultiline(true);
fieldDescription.setReadonly(true); fieldDescription.setReadonly(true);
fieldDescription.setHflex("1");
// //
ColumnInfo[] s_layoutWarehouse = new ColumnInfo[]{ ColumnInfo[] s_layoutWarehouse = new ColumnInfo[]{
@ -636,11 +642,6 @@ public class InfoProductPanel extends InfoPanel implements EventListener
where.toString(), where.toString(),
"QtyAvailable DESC"); "QtyAvailable DESC");
//
pickWarehouse.addEventListener(Events.ON_SELECT,this);
pickPriceList.addEventListener(Events.ON_SELECT,this);
pickProductCategory.addEventListener(Events.ON_SELECT, this); // Elaine 2008/11/21
pickAS.addEventListener(Events.ON_SELECT, this);
} // initInfo } // initInfo
/** /**