Search in sources :

Example 6 with WStringEditor

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;
}
Also used : MLocatorLookup(org.compiere.model.MLocatorLookup) WLocatorEditor(org.adempiere.webui.editor.WLocatorEditor) Row(org.adempiere.webui.component.Row) Separator(org.zkoss.zul.Separator) WStringEditor(org.adempiere.webui.editor.WStringEditor) Rows(org.adempiere.webui.component.Rows)

Example 7 with WStringEditor

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;
}
Also used : MLocatorLookup(org.compiere.model.MLocatorLookup) WLocatorEditor(org.adempiere.webui.editor.WLocatorEditor) WStringEditor(org.adempiere.webui.editor.WStringEditor)

Aggregations

WStringEditor (org.adempiere.webui.editor.WStringEditor)7 Listbox (org.adempiere.webui.component.Listbox)3 Row (org.adempiere.webui.component.Row)3 WLocatorEditor (org.adempiere.webui.editor.WLocatorEditor)3 WNumberEditor (org.adempiere.webui.editor.WNumberEditor)3 MLocatorLookup (org.compiere.model.MLocatorLookup)3 Separator (org.zkoss.zul.Separator)3 Timestamp (java.sql.Timestamp)2 Label (org.adempiere.webui.component.Label)2 Rows (org.adempiere.webui.component.Rows)2 WEditor (org.adempiere.webui.editor.WEditor)2 WTableDirEditor (org.adempiere.webui.editor.WTableDirEditor)2 IOException (java.io.IOException)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Button (org.adempiere.webui.component.Button)1 NumberBox (org.adempiere.webui.component.NumberBox)1 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)1 GridField (org.compiere.model.GridField)1