use of org.adempiere.webui.editor.WStringEditor in project adempiere by adempiere.
the class WScanBarUI method createProductPanel.
/**
* Creates the New Charge panel.
*
* The New Charge panel is used to specify the name and key of an account
* and whether or not the account is a charge account.
*/
private void createProductPanel() {
// load Locator
locatorLabel.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID"));
locatorLabel.setMandatory(true);
MLocatorLookup locator = new MLocatorLookup(Env.getCtx(), form.getWindowNo());
locator.setOnly_Warehouse_ID(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"));
locatorField = new WLocatorEditor("M_Locator_ID", true, false, true, locator, form.getWindowNo());
locatorField.setMandatory(true);
locatorField.addValueChangeListener(this);
locatorToLabel.setValue(Msg.translate(Env.getCtx(), "M_LocatorTo_ID"));
locatorToLabel.setVisible(false);
MLocatorLookup locatorTo = new MLocatorLookup(Env.getCtx(), form.getWindowNo());
locatorToField = new WLocatorEditor("M_LocatorTo_ID", true, false, true, locatorTo, form.getWindowNo());
//locatorField.setMandatory(true);
locatorToField.addValueChangeListener(this);
locatorToField.setVisible(false);
upcLabel.setText(Msg.getElement(Env.getCtx(), "Value", false));
upcLabel.setMandatory(true);
upcField = new WStringEditor("UPC", false, false, true, 10, 30, null, null);
upcField.getComponent().addEventListener(Events.ON_CHANGE, this);
qtyCountLabel.setText(Msg.getElement(Env.getCtx(), "QtyCount", false));
qtyCountField.getComponent().addEventListener(Events.ON_CHANGE, this);
lotLabel.setText(Msg.getElement(Env.getCtx(), "Lot", false));
lotField = new WStringEditor("Lot", false, false, true, 10, 30, null, null);
lotField.getComponent().addEventListener(Events.ON_CHANGE, this);
serNoLabel.setText(Msg.getElement(Env.getCtx(), "SerNo", false));
serNoField = new WStringEditor("SerNo", false, false, true, 10, 30, null, null);
serNoField.getComponent().addEventListener(Events.ON_CHANGE, this);
productValueLabel.setValue(Msg.translate(Env.getCtx(), "Value"));
productLabel.setValue(Msg.translate(Env.getCtx(), "Name"));
UOMLabel.setValue(Msg.translate(Env.getCtx(), "C_UOM_ID"));
Rows rows = new Rows();
newGrid.appendChild(rows);
Row row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(locatorLabel);
row.appendChild(locatorField.getComponent());
row = new Row();
rows.appendChild(row);
row.appendChild(locatorToLabel);
row.appendChild(locatorToField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(upcLabel);
row.appendChild(upcField.getComponent());
row.appendChild(qtyCountLabel);
row.appendChild(qtyCountField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(serNoLabel);
row.appendChild(serNoField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(lotLabel);
row.appendChild(lotField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
//Product Info
productValueField.setReadonly(true);
row = new Row();
rows.appendChild(row);
row.appendChild(productValueLabel);
row.appendChild(productValueField);
productField.setReadonly(true);
row.appendChild(productLabel);
row.appendChild(productField);
UOMField.setReadonly(true);
row.appendChild(UOMLabel);
row.appendChild(UOMField);
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
upcField.setVisible(false);
qtyCountField.setVisible(false);
lotField.setVisible(false);
serNoField.setVisible(false);
return;
}
use of org.adempiere.webui.editor.WStringEditor in project adempiere by adempiere.
the class WCreateFromShipmentUI method dynInit.
/**
* Dynamic Init
* @throws Exception if Lookups cannot be initialized
* @return true if initialized
*/
public boolean dynInit() throws Exception {
log.config("");
sameWarehouseCb.setSelected(true);
sameWarehouseCb.addActionListener(this);
// load Locator
MLocatorLookup locator = new MLocatorLookup(Env.getCtx(), p_WindowNo);
locatorField = new WLocatorEditor("M_Locator_ID", true, false, true, locator, p_WindowNo);
initBPartner(false);
bPartnerField.addValueChangeListener(this);
locatorLabel.setMandatory(true);
upcField = new WStringEditor("UPC", false, false, true, 10, 30, null, null);
upcField.getComponent().addEventListener(Events.ON_CHANGE, this);
return true;
}
Aggregations