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();
}
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);
}
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;
}
Aggregations