Search in sources :

Example 1 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor 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);
}
Also used : WDateEditor(org.adempiere.webui.editor.WDateEditor) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) ValueChangeEvent(org.adempiere.exceptions.ValueChangeEvent) Event(org.zkoss.zk.ui.event.Event) WTableModelEvent(org.adempiere.webui.event.WTableModelEvent) WPAttributeEditor(org.adempiere.webui.editor.WPAttributeEditor)

Example 2 with WSearchEditor

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

the class WMerge method preInit.

//	preInit
/**
	 * 	Pre Init Line
	 *	@param index index
	 *	@param AD_Column_ID id
	 *	@param displayType display type
	 *	@param ColumnName column name
	 */
private void preInit(int index, int AD_Column_ID, int displayType, String ColumnName) {
    m_columnName[index] = ColumnName;
    String what = Msg.translate(Env.getCtx(), ColumnName);
    m_label[index] = new Label(what);
    Lookup lookup = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, AD_Column_ID, displayType);
    if (displayType == DisplayType.Search) {
        m_from[index] = new WSearchEditor(ColumnName, false, false, true, lookup);
        m_to[index] = new WSearchEditor(ColumnName, false, false, true, lookup);
    } else {
        m_from[index] = new WTableDirEditor(ColumnName, false, false, true, lookup);
        m_to[index] = new WTableDirEditor(ColumnName, false, false, true, lookup);
    }
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) Label(org.adempiere.webui.component.Label) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Lookup(org.compiere.model.Lookup)

Example 3 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor 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 4 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor 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 5 with WSearchEditor

use of org.adempiere.webui.editor.WSearchEditor 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

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