use of org.adempiere.exceptions.ValueChangeEvent in project adempiere by adempiere.
the class WOrderReceiptIssue method valueChange.
// executeQuery
@Override
public void valueChange(ValueChangeEvent e) {
String name = e.getPropertyName();
Object value = e.getNewValue();
if (value == null)
return;
// PP_Order_ID
if (name.equals("PP_Order_ID")) {
orderField.setValue(value);
MPPOrder pp_order = getPP_Order();
if (pp_order != null) {
setS_Resource_ID(pp_order.getS_Resource_ID());
setM_Warehouse_ID(pp_order.getM_Warehouse_ID());
setDeliveredQty(pp_order.getQtyDelivered());
setOrderedQty(pp_order.getQtyOrdered());
//m_PP_order.getQtyOrdered().subtract(m_PP_order.getQtyDelivered());
setQtyBatchs(pp_order.getQtyBatchs());
setQtyBatchSize(pp_order.getQtyBatchSize());
setOpenQty(pp_order.getQtyOrdered().subtract(pp_order.getQtyDelivered()));
setToDeliverQty(getOpenQty());
setM_Product_ID(pp_order.getM_Product_ID());
MProduct m_product = MProduct.get(Env.getCtx(), pp_order.getM_Product_ID());
setC_UOM_ID(m_product.getC_UOM_ID());
setOrder_UOM_ID(pp_order.getC_UOM_ID());
//Default ASI defined from the Parent BOM Order
setM_AttributeSetInstance_ID(pp_order.getMPPOrderBOM().getM_AttributeSetInstance_ID());
//default to first entry - isBackflush
pickcombo.setSelectedIndex(0);
Event ev = new Event(Events.ON_CHANGE, pickcombo);
try {
onEvent(ev);
} catch (Exception e1) {
throw new AdempiereException(e1);
}
}
}
if (name.equals(toDeliverQty.getColumnName()) || name.equals(scrapQtyField.getColumnName())) {
if (getPP_Order_ID() > 0 && isBackflush()) {
executeQuery();
}
}
}
use of org.adempiere.exceptions.ValueChangeEvent in project adempiere by adempiere.
the class WGraph method loadData.
private void loadData() {
list = builder.loadData();
if (m_renderChart && m_chartSelection) {
Toolbar toolbar = new Toolbar();
panel.appendChild(toolbar);
int AD_Reference_Value_ID = DB.getSQLValue(null, "SELECT AD_Reference_ID FROM AD_Reference WHERE Name = ?", "PA_Goal ChartType");
MLookupInfo info = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), AD_Reference_Value_ID);
MLookup mLookup = new MLookup(info, 0);
WTableDirEditor editor = new WTableDirEditor("ChartType", false, false, true, mLookup);
toolbar.appendChild(editor.getComponent());
editor.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent evt) {
Object value = evt.getNewValue();
if (value == null || value.toString().trim().length() == 0)
return;
JFreeChart chart = null;
chart = builder.createChart(value.toString());
if (chart != null)
render(chart);
}
});
}
}
use of org.adempiere.exceptions.ValueChangeEvent in project adempiere by adempiere.
the class InfoPanel method zoom.
public void zoom() {
if (listeners != null && listeners.size() > 0) {
ValueChangeEvent event = new ValueChangeEvent(this, "zoom", p_table.getSelectedRowKey(), p_table.getSelectedRowKey());
fireValueChange(event);
} else {
Integer recordId = p_table.getSelectedRowKey();
int AD_Table_ID = MTable.getTable_ID(p_tableName);
if (AD_Table_ID <= 0) {
if (p_keyColumn.endsWith("_ID")) {
AD_Table_ID = MTable.getTable_ID(p_keyColumn.substring(0, p_keyColumn.length() - 3));
}
}
if (AD_Table_ID > 0)
AEnv.zoom(AD_Table_ID, recordId);
}
}
use of org.adempiere.exceptions.ValueChangeEvent in project adempiere by adempiere.
the class InfoPanel method valueChange.
// onEvent
/**
* Capture value changes in WSearchEditor components specifically.
* Copy and override as required.
* @param evt
*/
public void valueChange(ValueChangeEvent evt) {
Object c = null;
if (evt.getSource() instanceof WSearchEditor)
c = ((WSearchEditor) evt.getSource()).getComponent();
else if (evt.getSource() instanceof WPAttributeEditor)
c = ((WPAttributeEditor) evt.getSource()).getComponent();
if (c == null)
return;
// Pass it off to the event handler to process.
Event e = new Event("onChange", (Component) c);
onEvent(e);
}
use of org.adempiere.exceptions.ValueChangeEvent in project adempiere by adempiere.
the class WPaySelect method valueChange.
/**
* Capture value changes in WSearchEditor components specifically.
* Copy and override as required.
* @param evt
*/
public void valueChange(ValueChangeEvent evt) {
Object c = null;
if (evt.getSource() instanceof WSearchEditor)
c = ((WSearchEditor) evt.getSource()).getComponent();
else if (evt.getSource() instanceof WPAttributeEditor)
c = ((WPAttributeEditor) evt.getSource()).getComponent();
else if (evt.getSource() instanceof WDateEditor)
c = ((WDateEditor) evt.getSource()).getComponent();
if (c == null)
return;
// Pass it off to the event handler to process.
Event e = new Event("onChange", (Component) c);
onEvent(e);
}
Aggregations