Search in sources :

Example 21 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.

the class WCreateFromInvoiceUI method initBPartner.

//  vetoableChange
/**************************************************************************
	 *  Load BPartner Field
	 *  @param forInvoice true if Invoices are to be created, false receipts
	 *  @throws Exception if Lookups cannot be initialized
	 */
protected void initBPartner(boolean forInvoice) throws Exception {
    //  load BPartner
    //  C_Invoice.C_BPartner_ID
    int AD_Column_ID = 3499;
    MLookup lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
    bPartnerField = new WSearchEditor("C_BPartner_ID", true, false, true, lookup);
    //
    int C_BPartner_ID = getC_BPartner_ID();
    bPartnerField.setValue(new Integer(C_BPartner_ID));
    //  initial loading
    initBPOrderDetails(C_BPartner_ID, forInvoice);
}
Also used : MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor)

Example 22 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.

the class WOrderReceiptIssue method fillPicks.

//	init
/**
	 *	Fill Picks
	 *		Column_ID from C_Order
	 *	This is only run as part of the windows initialization process
	 *  @throws Exception if Lookups cannot be initialized
	 */
private void fillPicks() throws Exception {
    Properties ctx = Env.getCtx();
    // Base Language
    Language language = Language.getLoginLanguage();
    MLookup orderLookup = MLookupFactory.get(ctx, m_WindowNo, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_PP_Order_ID), DisplayType.Search, language, "PP_Order_ID", 0, false, "PP_Order.DocStatus = '" + MPPOrder.DOCACTION_Complete + "'");
    orderField = new WSearchEditor(MPPOrder.COLUMNNAME_PP_Order_ID, false, false, true, orderLookup);
    orderField.addValueChangeListener(this);
    MLookup resourceLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_S_Resource_ID), DisplayType.TableDir);
    resourceField = new WSearchEditor(MPPOrder.COLUMNNAME_S_Resource_ID, false, false, false, resourceLookup);
    MLookup warehouseLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir);
    warehouseField = new WSearchEditor(MPPOrder.COLUMNNAME_M_Warehouse_ID, false, false, false, warehouseLookup);
    MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Product_ID), DisplayType.TableDir);
    productField = new WSearchEditor(MPPOrder.COLUMNNAME_M_Product_ID, false, false, false, productLookup);
    MLookup uomLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
    uomField = new WSearchEditor(MPPOrder.COLUMNNAME_C_UOM_ID, false, false, false, uomLookup);
    MLookup uomOrderLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
    uomorderField = new WSearchEditor(MPPOrder.COLUMNNAME_C_UOM_ID, false, false, false, uomOrderLookup);
    MLocatorLookup locatorL = new MLocatorLookup(ctx, m_WindowNo);
    locatorField = new WLocatorEditor(MLocator.COLUMNNAME_M_Locator_ID, true, false, true, locatorL, m_WindowNo);
    //  Tab, Window
    int m_Window = MWindow.getWindow_ID("Manufacturing Order");
    GridFieldVO vo = GridFieldVO.createStdField(ctx, m_WindowNo, 0, m_Window, MTab.getTab_ID(m_Window, "Manufacturing Order"), false, false, false);
    vo.AD_Column_ID = MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID);
    vo.ColumnName = MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID;
    vo.displayType = DisplayType.PAttribute;
    GridField field = new GridField(vo);
    // M_AttributeSetInstance_ID
    attribute = new WPAttributeEditor(field.getGridTab(), field);
    attribute.setReadWrite(true);
    attribute.setValue(0);
    // 4Layers - Further init
    scrapQtyField.setValue(Env.ZERO);
    rejectQty.setValue(Env.ZERO);
    // 4Layers - end
    pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@IsBackflush@"), 1);
    pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@OnlyIssue@"), 2);
    pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@OnlyReceiptProduct@"), 3);
    pickcombo.addEventListener(Events.ON_CHANGE, this);
    Process.addActionListener(this);
    toDeliverQty.addValueChangeListener(this);
    scrapQtyField.addValueChangeListener(this);
}
Also used : MLocatorLookup(org.compiere.model.MLocatorLookup) WLocatorEditor(org.adempiere.webui.editor.WLocatorEditor) Language(org.compiere.util.Language) GridFieldVO(org.compiere.model.GridFieldVO) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) GridField(org.compiere.model.GridField) Properties(java.util.Properties) WPAttributeEditor(org.adempiere.webui.editor.WPAttributeEditor)

Example 23 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.

the class WCreateFromStatementUI method dynInit.

/**
	 *  Dynamic Init
	 *  @throws Exception if Lookups cannot be initialized
	 *  @return true if initialized
	 */
public boolean dynInit() throws Exception {
    log.config("");
    //Refresh button
    Button refreshButton = v_CreateFromPanel.getConfirmPanel().createButton(ConfirmPanel.A_REFRESH);
    refreshButton.addEventListener(Events.ON_CLICK, this);
    v_CreateFromPanel.getConfirmPanel().addButton(refreshButton);
    //  C_BankStatement.C_BankAccount_ID
    int AD_Column_ID = 4917;
    MLookup lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
    bankAccountField = new WTableDirEditor("C_BankAccount_ID", true, true, true, lookup);
    //  Set Default
    bankAccountField.setValue(getC_BankAccount_ID());
    //  initial Loading
    authorizationField = new WStringEditor("authorization", false, false, true, 10, 30, null, null);
    authorizationField.getComponent().addEventListener(Events.ON_CHANGE, this);
    lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_DocType_ID), DisplayType.TableDir);
    documentTypeField = new WTableDirEditor(MPayment.COLUMNNAME_C_DocType_ID, false, false, true, lookup);
    documentTypeField.getComponent().addEventListener(Events.ON_CHANGE, this);
    lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_TenderType), DisplayType.List);
    tenderTypeField = new WTableDirEditor(MPayment.COLUMNNAME_TenderType, false, false, true, lookup);
    tenderTypeField.getComponent().addEventListener(Events.ON_CHANGE, this);
    lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search);
    bPartnerLookup = new WSearchEditor("C_BPartner_ID", false, false, true, lookup);
    Timestamp date = Env.getContextAsDate(Env.getCtx(), p_WindowNo, MBankStatement.COLUMNNAME_StatementDate);
    dateToField.setValue(date);
    loadBankAccount();
    return true;
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) Button(org.adempiere.webui.component.Button) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Timestamp(java.sql.Timestamp) WStringEditor(org.adempiere.webui.editor.WStringEditor)

Example 24 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.

the class WTrxMaterial method dynParameter.

//  jbInit
/**
	 *  Initialize Parameter fields
	 *  @throws Exception if Lookups cannot be initialized
	 */
private void dynParameter() throws Exception {
    Properties ctx = Env.getCtx();
    //  Organization
    MLookup orgLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3660, DisplayType.TableDir);
    orgField = new WTableDirEditor("AD_Org_ID", false, false, true, orgLookup);
    //	orgField.addVetoableChangeListener(this);
    //  Locator
    MLocatorLookup locatorLookup = new MLocatorLookup(ctx, m_WindowNo);
    locatorField = new WLocatorEditor("M_Locator_ID", false, false, true, locatorLookup, m_WindowNo);
    //	locatorField.addVetoableChangeListener(this);
    //  Product
    MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3668, DisplayType.Search);
    productField = new WSearchEditor("M_Product_ID", false, false, true, productLookup);
    productField.addValueChangeListener(this);
    //  Movement Type
    MLookup mtypeLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3666, DisplayType.List);
    mtypeField = new WTableDirEditor("MovementType", false, false, true, mtypeLookup);
    //  Dates
    dateFField = new WDateEditor("DateFrom", false, false, true, Msg.getMsg(Env.getCtx(), "DateFrom"));
    dateTField = new WDateEditor("DateTo", false, false, true, Msg.getMsg(Env.getCtx(), "DateTo"));
    //
    confirmPanel.addActionListener(this);
    statusBar.setStatusLine("");
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) MLocatorLookup(org.compiere.model.MLocatorLookup) WLocatorEditor(org.adempiere.webui.editor.WLocatorEditor) WDateEditor(org.adempiere.webui.editor.WDateEditor) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Properties(java.util.Properties)

Example 25 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.

the class WStocktake method dynParameter.

//  jbInit
/**
	 *  Initialize Parameter fields
	 *  @throws Exception if Lookups cannot be initialized
	 */
private void dynParameter() throws Exception {
    Properties ctx = Env.getCtx();
    //  Physical Inventory
    String vcode = "M_Inventory.IsStocktake='Y' ";
    MLookup inventoryLookup = MLookupFactory.get(ctx, m_WindowNo, 3563, DisplayType.TableDir, Env.getLanguage(Env.getCtx()), "M_Inventory_ID", 53249, true, vcode);
    inventoryField = new WTableDirEditor("M_Inventory_ID", false, false, true, inventoryLookup);
    //  Locator
    MLocatorLookup locatorLookup = new MLocatorLookup(ctx, m_WindowNo);
    locatorField = new WLocatorEditor("M_Locator_ID", false, false, true, locatorLookup, m_WindowNo);
    //	locatorField.addVetoableChangeListener(this);
    //  Product
    MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3668, DisplayType.Search);
    productField = new WSearchEditor("M_Product_ID", false, false, true, productLookup);
    productField.addValueChangeListener(this);
    // Aisle(X)
    MLookup aislexLookup = MLookupFactory.get(ctx, m_WindowNo, 1399, DisplayType.Table, Env.getLanguage(Env.getCtx()), "X", 53562, false, null);
    aislexField = new WTableDirEditor("X", false, false, true, aislexLookup);
    //  Dates
    lineFField = new WNumberEditor();
    lineTField = new WNumberEditor();
    //
    confirmPanel.addActionListener(this);
    statusBar.setStatusLine("");
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) MLocatorLookup(org.compiere.model.MLocatorLookup) WLocatorEditor(org.adempiere.webui.editor.WLocatorEditor) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Properties(java.util.Properties) WNumberEditor(org.adempiere.webui.editor.WNumberEditor)

Aggregations

WSearchEditor (org.adempiere.webui.editor.WSearchEditor)28 MLookup (org.compiere.model.MLookup)17 WTableDirEditor (org.adempiere.webui.editor.WTableDirEditor)8 Properties (java.util.Properties)6 SimpleDateFormat (java.text.SimpleDateFormat)5 Row (org.adempiere.webui.component.Row)5 Rows (org.adempiere.webui.component.Rows)5 DecimalFormat (java.text.DecimalFormat)4 Datebox (org.adempiere.webui.component.Datebox)4 Label (org.adempiere.webui.component.Label)4 NumberBox (org.adempiere.webui.component.NumberBox)3 Textbox (org.adempiere.webui.component.Textbox)3 WLocatorEditor (org.adempiere.webui.editor.WLocatorEditor)3 WPAttributeEditor (org.adempiere.webui.editor.WPAttributeEditor)3 WTableModelEvent (org.adempiere.webui.event.WTableModelEvent)3 MLocatorLookup (org.compiere.model.MLocatorLookup)3 KeyNamePair (org.compiere.util.KeyNamePair)3 Language (org.compiere.util.Language)3 Event (org.zkoss.zk.ui.event.Event)3 Hbox (org.zkoss.zul.Hbox)3