use of org.adempiere.webui.window.ADWindow in project adempiere by adempiere.
the class WRequest method onEvent.
// getZoomTargets
public void onEvent(Event e) throws Exception {
if (e.getTarget() instanceof Menuitem) {
MQuery query = null;
if (e.getTarget() == m_active) {
query = new MQuery("");
String where = "(" + m_where + ") AND Processed='N'";
query.addRestriction(where);
query.setRecordCount(0);
} else if (e.getTarget() == m_all) {
query = new MQuery("");
query.addRestriction(m_where.toString());
query.setRecordCount(0);
} else if (e.getTarget() == m_new) {
query = new MQuery("");
query.addRestriction("1=2");
query.setRecordCount(0);
}
// 232=all - 201=my
int AD_Window_ID = 232;
ADWindow frame = SessionManager.getAppDesktop().openWindow(AD_Window_ID, query);
if (frame == null)
return;
// New - set Table/Record
if (e.getTarget() == m_new) {
GridTab tab = frame.getADWindowPanel().getActiveGridTab();
tab.dataNew(false);
tab.setValue("AD_Table_ID", new Integer(m_AD_Table_ID));
tab.setValue("Record_ID", new Integer(m_Record_ID));
//
if (m_C_BPartner_ID != 0)
tab.setValue("C_BPartner_ID", new Integer(m_C_BPartner_ID));
//
if (m_AD_Table_ID == I_C_BPartner.Table_ID)
tab.setValue("C_BPartner_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_AD_User.Table_ID)
tab.setValue("AD_User_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_C_Project.Table_ID)
tab.setValue("C_Project_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_A_Asset.Table_ID)
tab.setValue("A_Asset_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_C_Order.Table_ID)
tab.setValue("C_Order_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_C_Invoice.Table_ID)
tab.setValue("C_Invoice_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_M_Product.Table_ID)
tab.setValue("M_Product_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_C_Payment.Table_ID)
tab.setValue("C_Payment_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_M_InOut.Table_ID)
tab.setValue("M_InOut_ID", new Integer(m_Record_ID));
else if (m_AD_Table_ID == I_M_RMA.Table_ID)
tab.setValue("M_RMA_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_C_Campaign.Table_ID)
tab.setValue("C_Campaign_ID", new Integer(m_Record_ID));
else //
if (m_AD_Table_ID == I_R_Request.Table_ID)
tab.setValue(I_R_Request.COLUMNNAME_R_RequestRelated_ID, new Integer(m_Record_ID));
else // FR [2842165] - Order Ref link from SO line creating new request
if (m_AD_Table_ID == I_C_OrderLine.Table_ID) {
MOrderLine oLine = new MOrderLine(Env.getCtx(), m_Record_ID, null);
if (oLine != null) {
tab.setValue(I_C_OrderLine.COLUMNNAME_C_Order_ID, new Integer(oLine.getC_Order_ID()));
}
}
}
frame = null;
}
}
Aggregations