use of org.adempiere.webui.editor.WTableDirEditor in project adempiere by adempiere.
the class WGraph method loadData.
private void loadData() {
list = builder.loadData();
if (m_renderChart && m_chartSelection) {
Toolbar toolbar = new Toolbar();
panel.appendChild(toolbar);
int AD_Reference_Value_ID = DB.getSQLValue(null, "SELECT AD_Reference_ID FROM AD_Reference WHERE Name = ?", "PA_Goal ChartType");
MLookupInfo info = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), AD_Reference_Value_ID);
MLookup mLookup = new MLookup(info, 0);
WTableDirEditor editor = new WTableDirEditor("ChartType", false, false, true, mLookup);
toolbar.appendChild(editor.getComponent());
editor.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent evt) {
Object value = evt.getNewValue();
if (value == null || value.toString().trim().length() == 0)
return;
JFreeChart chart = null;
chart = builder.createChart(value.toString());
if (chart != null)
render(chart);
}
});
}
}
use of org.adempiere.webui.editor.WTableDirEditor in project adempiere by adempiere.
the class InfoCashLinePanel method statInit.
// InfoCashLinePanel
/**
* Static Setup - add fields to parameterPanel
* @throws Exception if Lookups cannot be created
*/
private void statInit() {
// Format the dates and number boxes
fDateFrom.setWidth("97px");
fDateTo.setWidth("97px");
fAmtFrom.getDecimalbox().setWidth("90px");
fAmtTo.getDecimalbox().setWidth("90px");
fDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_DateFrom");
fDateFrom.addEventListener(Events.ON_CHANGE, this);
fDateTo.setAttribute("zk_component_ID", "Lookup_Criteria_DateTo");
fDateTo.addEventListener(Events.ON_CHANGE, this);
fAmtFrom.setAttribute("zk_component_ID", "Lookup_Criteria_AmtFrom");
fAmtFrom.addEventListener(Events.ON_CHANGE, this);
fAmtTo.setAttribute("zk_component_ID", "Lookup_Criteria_AmtTo");
fAmtTo.addEventListener(Events.ON_CHANGE, this);
SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
fDateFrom.setFormat(dateFormat.toPattern());
fDateTo.setFormat(dateFormat.toPattern());
DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount, AEnv.getLanguage(Env.getCtx()));
fAmtFrom.getDecimalbox().setFormat(format.toPattern());
fAmtFrom.getDecimalbox().setStyle("text-align:right; " + fAmtFrom.getDecimalbox().getStyle());
fAmtTo.getDecimalbox().setFormat(format.toPattern());
fAmtTo.getDecimalbox().setStyle("text-align:right; " + fAmtTo.getDecimalbox().getStyle());
// Create the main criteria fields
// 5241 - C_Cash.C_Cash_ID
fCash_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, p_TabNo, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_Cash_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Cash_ID"), "", false, false, true);
fCash_ID.addValueChangeListener(this);
fCash_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Cash_ID");
// 5249 - C_Cash.C_CashBook_ID
fCashBook_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_CashBook_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_CashBook_ID"), "", false, false, true);
fCashBook_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
//fCashBook_ID.addValueChangeListener(this);
fCashBook_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_CashBook_ID");
// Width is set in WTableDirEditor to 200px. Make it more flexible;
fCashBook_ID.getComponent().setWidth("100%");
// 5354 - C_CashLine.C_Invoice_ID
fInvoice_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Invoice_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_Invoice_ID"), "", false, false, true);
fInvoice_ID.addValueChangeListener(this);
fInvoice_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Invoice_ID");
// 5296 - C_CashLine.C_Charge_ID
fPayment_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Payment_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Payment_ID"), "", false, false, true);
fPayment_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Payment_ID");
// 5295 - C_CashLine.C_BankAccount_ID
fBankAccount_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_BankAccount_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_BankAccount_ID"), "", false, false, true);
fBankAccount_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
//fBankAccount_ID.addValueChangeListener(this);
fBankAccount_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
// Width is set in WTableDirEditor to 200px. Make it more flexible;
fBankAccount_ID.getComponent().setWidth("100%");
// 5296 - C_CashLine.C_Charge_ID
fCharge_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Charge_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Charge_ID"), "", false, false, true);
fCharge_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
fCharge_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Charge_ID");
// Width is set in WTableDirEditor to 200px. Make it more flexible;
fCharge_ID.getComponent().setWidth("100%");
cbAbsolute.setLabel(Msg.translate(Env.getCtx(), "AbsoluteAmt"));
cbAbsolute.addEventListener(Events.ON_CHECK, this);
cbAbsolute.setAttribute("zk_component_ID", "Lookup_Criteria_AbsoluteAmt");
// Setup the criteria. The rest of the panel is managed by the info.java class
Rows rows = new Rows();
Row row = new Row();
rows.appendChild(row);
row.appendChild(fCashBook_ID.getLabel().rightAlign());
row.appendChild(fCashBook_ID.getComponent());
row.appendChild(fCash_ID.getLabel().rightAlign());
row.appendChild(fCash_ID.getComponent());
row = new Row();
rows.appendChild(row);
row.appendChild(fInvoice_ID.getLabel().rightAlign());
row.appendChild(fInvoice_ID.getComponent());
row.appendChild(fPayment_ID.getLabel().rightAlign());
row.appendChild(fPayment_ID.getComponent());
row = new Row();
//row.setSpans("1, 1, 1, 1");
rows.appendChild(row);
row.appendChild(fBankAccount_ID.getLabel().rightAlign());
row.appendChild(fBankAccount_ID.getComponent());
row.appendChild(lDateFrom.rightAlign());
Hbox hbox = new Hbox();
hbox.appendChild(fDateFrom);
hbox.appendChild(lDateTo);
hbox.appendChild(fDateTo);
row.appendChild(hbox);
row = new Row();
//row.setSpans("1, 1, 1, 1");
rows.appendChild(row);
row.appendChild(fCharge_ID.getLabel().rightAlign());
row.appendChild(fCharge_ID.getComponent());
row.appendChild(lAmtFrom.rightAlign());
hbox = new Hbox();
hbox.appendChild(fAmtFrom);
hbox.appendChild(lAmtTo);
hbox.appendChild(fAmtTo);
hbox.appendChild(cbAbsolute);
row.appendChild(hbox);
p_criteriaGrid.appendChild(rows);
super.setSizes();
}
use of org.adempiere.webui.editor.WTableDirEditor in project adempiere by adempiere.
the class InfoProductPanel method initComponents.
// InfoProductPanel
/**
* initialize fields
*/
private void initComponents() {
lblBlank.setValue(" ");
lblValue = new Label();
lblValue.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Value")));
lblName = new Label();
lblName.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Name")));
lblUPC = new Label();
lblUPC.setValue(Msg.translate(Env.getCtx(), "UPC"));
lblSKU = new Label();
lblSKU.setValue(Msg.translate(Env.getCtx(), "SKU"));
lblPriceList = new Label();
lblPriceList.setValue(Msg.getMsg(Env.getCtx(), "PriceListVersion"));
// Elaine 2008/11/21
lblProductCategory = new Label();
lblProductCategory.setValue(Msg.translate(Env.getCtx(), "M_Product_Category_ID"));
//
lblAS = new Label();
lblAS.setValue(Msg.translate(Env.getCtx(), "M_AttributeSet_ID"));
lblASI = new Label();
lblASI.setValue(Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID"));
lblWarehouse = new Label();
lblWarehouse.setValue(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Warehouse")));
lblVendor = new Label();
lblVendor.setValue(Msg.translate(Env.getCtx(), "Vendor"));
checkOnlyStock = new Checkbox();
checkOnlyStock.setAttribute("zk_component_ID", "Lookup_Criteria_checkOnlyStock");
checkOnlyStock.setText(Msg.getMsg(Env.getCtx(), "OnlyStock"));
checkOnlyStock.setName("OnlyStock");
checkOnlyStock.setTooltiptext(Msg.getMsg(Env.getCtx(), "OnlyStockTip"));
// Info may open when searching for non-stock as well.
checkOnlyStock.setSelected(false);
checkOnlyStock.addActionListener(this);
checkShowDetail = new Checkbox();
checkShowDetail.setAttribute("zk_component_ID", "Lookup_Criteria_checkShowDetail");
checkShowDetail.setText(Msg.getMsg(Env.getCtx(), "ShowDetail"));
checkShowDetail.setName("ShowDetail");
checkShowDetail.setTooltiptext(Msg.getMsg(Env.getCtx(), "ShowAttributeDetails"));
checkShowDetail.setSelected(false);
checkShowDetail.setEnabled(false);
checkShowDetail.addActionListener(this);
checkAND = new Checkbox();
checkAND.setAttribute("zk_component_ID", "Lookup_Criteria_checkAND");
checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));
checkAND.setName("SearchAND");
checkAND.setTooltiptext(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));
checkAND.setSelected(true);
checkAND.addActionListener(this);
m_InfoPAttributeButton.setImage(ServletFns.resolveThemeURL("~./images/PAttribute16.png"));
m_InfoPAttributeButton.setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute"));
m_InfoPAttributeButton.addEventListener(Events.ON_CLICK, this);
fieldValue = new Textbox();
//fieldValue.setMaxlength(40);
fieldValue.setAttribute("zk_component_ID", "Lookup_Criteria_fieldValue");
fieldValue.addEventListener(Events.ON_CHANGE, this);
//
fieldName = new Textbox();
//fieldName.setMaxlength(40);
fieldName.setAttribute("zk_component_ID", "Lookup_Criteria_fieldName");
fieldName.addEventListener(Events.ON_CHANGE, this);
//
fieldUPC = new Textbox();
//fieldUPC.setMaxlength(40);
fieldUPC.setAttribute("zk_component_ID", "Lookup_Criteria_fieldUPC");
fieldUPC.addEventListener(Events.ON_CHANGE, this);
//
fieldSKU = new Textbox();
//fieldSKU.setMaxlength(40);
fieldSKU.setAttribute("zk_component_ID", "Lookup_Criteria_fieldSKU");
fieldSKU.addEventListener(Events.ON_CHANGE, this);
//
// Elaine 2008/11/25
fieldDescription.setMultiline(true);
fieldDescription.setReadonly(true);
fieldDescription.setAttribute("zk_component_ID", "Lookup_Field_Description");
//
fPriceList_ID = new WTableDirEditor("M_PriceList_Version_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPriceListVersion.Table_Name, MPriceListVersion.COLUMNNAME_M_PriceList_Version_ID), DisplayType.TableDir));
fPriceList_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
fPriceList_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_PriceList_Version_ID");
fPriceList_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fPriceList_ID.getComponent().setAttribute("IsDynamic", "True");
fPriceList_ID.getComponent().setAttribute("fieldName", "fPriceList_ID");
// Elaine 2008/11/21
fProductCategory_ID = new WTableDirEditor("M_Product_Category_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MProductCategory.Table_Name, MProductCategory.COLUMNNAME_M_Product_Category_ID), DisplayType.TableDir));
fProductCategory_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
fProductCategory_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_ProductCategory_ID");
fProductCategory_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fProductCategory_ID.getComponent().setAttribute("IsDynamic", "True");
fProductCategory_ID.getComponent().setAttribute("fieldName", "fProductCategory_ID");
//
fAS_ID = new WTableDirEditor("M_AttributeSet_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MAttributeSet.Table_Name, MAttributeSet.COLUMNNAME_M_AttributeSet_ID), DisplayType.TableDir));
fAS_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
fAS_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_PAttributeSet_ID");
fAS_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fAS_ID.getComponent().setAttribute("IsDynamic", "False");
fAS_ID.getComponent().setAttribute("fieldName", "fAS_ID");
fAS_ID.getComponent().setWidth("200px");
MPAttributeLookup mpaLookup = new MPAttributeLookup(Env.getCtx(), p_WindowNo);
fASI_ID = new WPAttributeEditor(null, false, false, true, p_WindowNo, mpaLookup, true);
fASI_ID.addValueChangeListener(this);
fASI_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_PAttributeSetInstance_ID");
fASI_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fASI_ID.getComponent().setAttribute("IsDynamic", "False");
fASI_ID.getComponent().setAttribute("fieldName", "fASI_ID");
fASI_ID.getComponent().setWidth("200px");
fWarehouse_ID = new WTableDirEditor("M_Warehouse_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MWarehouse.Table_Name, MWarehouse.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir));
fWarehouse_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
fWarehouse_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_Warehouse_ID");
fWarehouse_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fWarehouse_ID.getComponent().setAttribute("IsDynamic", "True");
fWarehouse_ID.getComponent().setAttribute("fieldName", "fWarehouse_ID");
//fVendor_ID.getComponent().getTextbox().setMaxlength(30);
// Override the isSOTrx context, Vendors only
fVendor_ID.setIsSOTrx(true, false);
fVendor_ID.addValueChangeListener(this);
fVendor_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
fVendor_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fVendor_ID.getComponent().setAttribute("IsDynamic", "False");
fVendor_ID.getComponent().setAttribute("fieldName", "fVendor_ID");
fVendor_ID.getComponent().setWidth("200px");
// Product Attribute Instance
m_PAttributeButton = confirmPanel.createButton(ConfirmPanel.A_PATTRIBUTE);
confirmPanel.addComponentsLeft(m_PAttributeButton);
m_PAttributeButton.addActionListener(this);
m_PAttributeButton.setEnabled(false);
//
fieldPAttributes.setMultiline(true);
fieldPAttributes.setReadonly(true);
fieldPAttributes.setAttribute("zk_component_ID", "Lookup_Field_PAAttributes");
initAtpTab();
}
use of org.adempiere.webui.editor.WTableDirEditor in project adempiere by adempiere.
the class WAllocation method dynInit.
// jbInit
/**
* Dynamic Init (prepare dynamic fields)
* @throws Exception if Lookups cannot be initialized
*/
public void dynInit() throws Exception {
// Currency
// C_Invoice.C_Currency_ID
int AD_Column_ID = 3505;
MLookup lookupCur = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
currencyPick = new WTableDirEditor("C_Currency_ID", true, false, true, lookupCur);
currencyPick.setValue(new Integer(m_C_Currency_ID));
currencyPick.addValueChangeListener(this);
// Organization filter selection
//C_Period.AD_Org_ID (needed to allow org 0)
AD_Column_ID = 839;
MLookup lookupOrg = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
organizationPick = new WTableDirEditor("AD_Org_ID", true, false, true, lookupOrg);
organizationPick.setValue(Env.getAD_Org_ID(Env.getCtx()));
organizationPick.addValueChangeListener(this);
// BPartner
// C_Invoice.C_BPartner_ID
AD_Column_ID = 3499;
MLookup lookupBP = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, AD_Column_ID, DisplayType.Search);
bpartnerSearch = new WSearchEditor("C_BPartner_ID", true, false, true, lookupBP);
bpartnerSearch.addValueChangeListener(this);
// Translation
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "AllocateStatus"));
statusBar.setStatusDB("");
// Date set to Login Date
dateField.setValue(Env.getContextAsDate(Env.getCtx(), "#Date"));
dateField.addValueChangeListener(this);
// C_AllocationLine.C_Charge_ID
AD_Column_ID = 61804;
MLookup lookupCharge = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
chargePick = new WTableDirEditor("C_Charge_ID", true, false, true, lookupCharge);
chargePick.setValue(new Integer(m_C_Charge_ID));
chargePick.addValueChangeListener(this);
// APAR
// T_InvoiceGL.APAR
AD_Column_ID = 14082;
MLookup lookupAPAR = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, AD_Column_ID, DisplayType.List);
aparPick = new WTableDirEditor("APAR", true, false, true, lookupAPAR);
aparPick.setValue(APAR_A);
aparPick.addValueChangeListener(this);
}
use of org.adempiere.webui.editor.WTableDirEditor 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);
}
}
Aggregations