Search in sources :

Example 26 with WSearchEditor

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

the class InfoAssetPanel method statInit.

// InfoAssetPanel
/**
	 *	Static Setup - add fields to parameterPanel
	 */
private void statInit() {
    fieldValue.setWidth("100%");
    fieldName.setWidth("100%");
    labelValue.setValue(Msg.getMsg(Env.getCtx(), "Value"));
    fieldValue.addEventListener(Events.ON_CHANGE, this);
    fieldValue.setAttribute("zk_component_ID", "Lookup_Criteria_fieldValue");
    labelName.setValue(Msg.getMsg(Env.getCtx(), "Name"));
    fieldName.addEventListener(Events.ON_CANCEL, this);
    fieldName.setAttribute("zk_component_ID", "Lookup_Criteria_fieldName");
    // From A_Asset.
    fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(I_A_Asset.Table_Name, I_A_Asset.COLUMNNAME_C_BPartner_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BPartner_ID"), "", false, false, true);
    fBPartner_ID.addValueChangeListener(this);
    fBPartner_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_fBPartner_ID");
    fProduct_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(I_A_Asset.Table_Name, I_A_Asset.COLUMNNAME_M_Product_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "M_Product_ID"), "", false, false, true);
    fProduct_ID.addValueChangeListener(this);
    fProduct_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_fProduct_ID");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(labelValue.rightAlign());
    row.appendChild(fieldValue);
    row.appendChild(fBPartner_ID.getLabel().rightAlign());
    row.appendChild(fBPartner_ID.getComponent());
    row = new Row();
    rows.appendChild(row);
    row.appendChild(labelName.rightAlign());
    row.appendChild(fieldName);
    row.appendChild(fProduct_ID.getLabel().rightAlign());
    row.appendChild(fProduct_ID.getComponent());
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
}
Also used : WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 27 with WSearchEditor

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

the class WEMailDialog method commonInit.

//	EmailDialog
/**
	 * 	Common Init
	 *	@param from from
	 *	@param to to 
	 *	@param subject subject
	 *	@param message message
	 *	@param attachment optional attachment
	 */
private void commonInit(MUser from, String to, String subject, String message, File attachment) {
    m_client = MClient.get(Env.getCtx());
    try {
        int WindowNo = 0;
        int AD_Column_ID = 0;
        Lookup lookup = MLookupFactory.get(Env.getCtx(), WindowNo, AD_Column_ID, DisplayType.Search, Env.getLanguage(Env.getCtx()), "AD_User_ID", 0, false, "EMail IS NOT NULL");
        fUser = new WSearchEditor(lookup, "AD_User_ID", "", false, false, true);
        fUser.addValueChangeListener(this);
        fCcUser = new WSearchEditor(lookup, "AD_User_ID", "", false, false, true);
        fCcUser.addValueChangeListener(this);
        jbInit();
    } catch (Exception ex) {
        log.log(Level.SEVERE, "EMailDialog", ex);
    }
    set(from, to, subject, message);
    setAttachment(attachment);
    AEnv.showCenterScreen(this);
}
Also used : WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Lookup(org.compiere.model.Lookup) PropertyVetoException(java.beans.PropertyVetoException)

Example 28 with WSearchEditor

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

the class WEMailDialog method valueChange.

/**
	 * 	Vetoable Change - User selected 
	 *	@param evt
	 *	@throws PropertyVetoException
	 */
public void valueChange(ValueChangeEvent evt) {
    WSearchEditor source = (WSearchEditor) evt.getSource();
    Object value = evt.getNewValue();
    log.info("Value=" + value);
    if (value == null) {
        return;
    }
    if (source.equals(fUser)) {
        // fUser			
        if (value == null)
            fTo.setText("");
        if (value instanceof Integer) {
            int AD_User_ID = ((Integer) value).intValue();
            m_user = MUser.get(Env.getCtx(), AD_User_ID);
            fTo.setValue(m_user.getEMail());
        }
    } else {
        // fCcUser
        if (value == null)
            fCc.setText("");
        if (value instanceof Integer) {
            int AD_User_ID = ((Integer) value).intValue();
            m_ccuser = MUser.get(Env.getCtx(), AD_User_ID);
            fCc.setValue(m_ccuser.getEMail());
        }
    }
    return;
}
Also used : WSearchEditor(org.adempiere.webui.editor.WSearchEditor)

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