Search in sources :

Example 1 with MLookup

use of org.compiere.model.MLookup in project adempiere by adempiere.

the class VCreateFromRMAUI 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 VLookup("C_BPartner_ID", true, false, true, lookup);
    //
    int C_BPartner_ID = getC_BPartner_ID();
    bPartnerField.setValue(new Integer(C_BPartner_ID));
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup)

Example 2 with MLookup

use of org.compiere.model.MLookup in project adempiere by adempiere.

the class WPayPrint method dynInit.

//  VPayPrint
/**
	 *  Dynamic Init
	 */
private void dynInit() {
    //  C_PaySelection_ID
    //  C_PaySelectionCheck.C_PaySelection_ID
    int AD_Column_ID = 7670;
    //	FR [ 297 ]
    //	Add DocStatus for validation
    MLookupInfo info = MLookupFactory.getLookupInfo(Env.getCtx(), windowNo, AD_Column_ID, DisplayType.Search);
    info.ValidationCode = "C_PaySelection.DocStatus IN('CO', 'CL') AND C_PaySelection.C_BankAccount_ID IS NOT NULL";
    MLookup lookupPS = new MLookup(info, 0);
    paySelectSearch = new WSearchEditor("C_PaySelection_ID", true, false, true, lookupPS);
    paySelectSearch.addValueChangeListener(this);
}
Also used : MLookupInfo(org.compiere.model.MLookupInfo) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) PayPrint(org.compiere.apps.form.PayPrint)

Example 3 with MLookup

use of org.compiere.model.MLookup in project adempiere by adempiere.

the class WInvoiceGen method dynInit.

//	jbInit
/**
	 *	Fill Picks.
	 *		Column_ID from C_Order
	 *  @throws Exception if Lookups cannot be initialized
	 */
public void dynInit() throws Exception {
    MLookup orgL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2163, DisplayType.TableDir);
    fOrg = new WTableDirEditor("AD_Org_ID", false, false, true, orgL);
    //	lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
    fOrg.addValueChangeListener(this);
    //
    MLookup bpL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2762, DisplayType.Search);
    fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
    //	lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fBPartner.addValueChangeListener(this);
    //      Document Action Prepared/ Completed
    lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction"));
    MLookup docActionL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 3495, /* C_Invoice.DocAction */
    DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135, /* _Document Action */
    false, "AD_Ref_List.Value IN ('CO','PR')");
    docAction = new WTableDirEditor("DocAction", true, false, true, docActionL);
    docAction.setValue(DocAction.ACTION_Complete);
    docAction.addValueChangeListener(this);
    //      Document Type Sales Order/Vendor RMA
    lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order")));
    cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "CustomerRMA")));
    cmbDocType.addActionListener(this);
    cmbDocType.setSelectedIndex(0);
    //@@
    form.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) KeyNamePair(org.compiere.util.KeyNamePair)

Example 4 with MLookup

use of org.compiere.model.MLookup in project adempiere by adempiere.

the class WDelete method dynInit.

public void dynInit() throws Exception {
    // Client Pick
    String sql = "SELECT AD_Client_ID, Name FROM AD_Client WHERE AD_Client_ID <> 0";
    clientPick = new Combobox();
    PreparedStatement pstmt1 = DB.prepareStatement(sql, null);
    ResultSet rs1 = null;
    String clientName = null;
    Integer clientID = null;
    try {
        rs1 = pstmt1.executeQuery();
        while (rs1.next()) {
            clientID = new Integer(rs1.getInt(1));
            clientName = new String(rs1.getString(2));
            clientPick.appendItem(clientName, clientID);
            clientMap.put(clientName, clientID);
        }
    } catch (SQLException e) {
        System.out.println(e);
    } finally {
        DB.close(rs1);
        DB.close(pstmt1);
    }
    // Table Pick
    MLookup lookupTable = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, ad_table_id, DisplayType.TableDir);
    tablePick = new WTableDirEditor("AD_Table_ID", true, false, true, lookupTable);
    tablePick.setValue(new Integer((Integer) Env.getContextAsInt(Env.getCtx(), "$AD_Table_ID")));
    tablePick.addValueChangeListener(this);
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) SQLException(java.sql.SQLException) Combobox(org.adempiere.webui.component.Combobox) MLookup(org.compiere.model.MLookup) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement)

Example 5 with MLookup

use of org.compiere.model.MLookup in project adempiere by adempiere.

the class WInOutGen method dynInit.

//	jbInit
/**
	 *	Fill Picks.
	 *		Column_ID from C_Order
	 *  @throws Exception if Lookups cannot be initialized
	 */
public void dynInit() throws Exception {
    //	C_OrderLine.M_Warehouse_ID
    MLookup orgL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2223, DisplayType.TableDir);
    fWarehouse = new WTableDirEditor("M_Warehouse_ID", true, false, true, orgL);
    lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
    fWarehouse.addValueChangeListener(this);
    fWarehouse.setValue(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"));
    setM_Warehouse_ID(fWarehouse.getValue());
    //      Document Action Prepared/ Completed
    lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction"));
    MLookup docActionL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 4324, /* M_InOut.DocAction */
    DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135, /* _Document Action */
    false, "AD_Ref_List.Value IN ('CO','PR')");
    docAction = new WTableDirEditor("DocAction", true, false, true, docActionL);
    docAction.setValue(DocAction.ACTION_Complete);
    docAction.addValueChangeListener(this);
    //	C_Order.C_BPartner_ID
    MLookup bpL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2762, DisplayType.Search);
    fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
    lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fBPartner.addValueChangeListener(this);
    //Document Type Sales Order/Vendor RMA
    lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order")));
    cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA")));
    cmbDocType.addActionListener(this);
    cmbDocType.setSelectedIndex(0);
    //@@
    form.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InOutGenerateSel"));
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) KeyNamePair(org.compiere.util.KeyNamePair)

Aggregations

MLookup (org.compiere.model.MLookup)68 VLookup (org.compiere.grid.ed.VLookup)27 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)17 Properties (java.util.Properties)14 SQLException (java.sql.SQLException)12 KeyNamePair (org.compiere.util.KeyNamePair)11 WTableDirEditor (org.adempiere.webui.editor.WTableDirEditor)9 PreparedStatement (java.sql.PreparedStatement)8 ResultSet (java.sql.ResultSet)8 Language (org.compiere.util.Language)7 MLocatorLookup (org.compiere.model.MLocatorLookup)6 ValueNamePair (org.compiere.util.ValueNamePair)6 Dimension (java.awt.Dimension)5 Insets (java.awt.Insets)5 PropertyVetoException (java.beans.PropertyVetoException)5 CPanel (org.compiere.swing.CPanel)5 BigDecimal (java.math.BigDecimal)4 Timestamp (java.sql.Timestamp)4 Row (org.adempiere.webui.component.Row)4 Rows (org.adempiere.webui.component.Rows)4