use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.
the class InfoPanel method valueChange.
// onEvent
/**
* 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();
if (c == null)
return;
// Pass it off to the event handler to process.
Event e = new Event("onChange", (Component) c);
onEvent(e);
}
use of org.adempiere.webui.editor.WSearchEditor 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.WSearchEditor in project adempiere by adempiere.
the class InfoPaymentPanel method statInit.
// InfoPaymentPanel
/**
* Static Setup - add fields to parameterPanel
*/
private void statInit() {
fDocumentNo = new Textbox();
fDocumentNo.setWidth("100%");
fDocumentNo.addEventListener(Events.ON_CHANGE, this);
fDocumentNo.setAttribute("zk_component_ID", "Lookup_Criteria_fDocumentNo");
fDocumentNo.addEventListener(Events.ON_CHANGE, this);
// Format the dates and number boxes
fDateFrom = new Datebox();
fDateFrom.setWidth("97px");
fDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_DateFrom");
fDateFrom.addEventListener(Events.ON_CHANGE, this);
//
fDateTo = new Datebox();
fDateTo.setWidth("97px");
fDateTo.setAttribute("zk_component_ID", "Lookup_Criteria_DateTo");
fDateTo.addEventListener(Events.ON_CHANGE, this);
//
SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
fDateFrom.setFormat(dateFormat.toPattern());
fDateTo.setFormat(dateFormat.toPattern());
//
fAmtFrom = new NumberBox(false);
fAmtFrom.getDecimalbox().setWidth("90px");
fAmtFrom.setAttribute("zk_component_ID", "Lookup_Criteria_AmtFrom");
fAmtFrom.addEventListener(Events.ON_CHANGE, this);
//
fAmtTo = new NumberBox(false);
fAmtTo.getDecimalbox().setWidth("90px");
fAmtTo.setAttribute("zk_component_ID", "Lookup_Criteria_AmtTo");
fAmtTo.addEventListener(Events.ON_CHANGE, this);
//
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());
//
fCheckReceipt.setLabel(Msg.translate(Env.getCtx(), "OnlyReceipt"));
fCheckReceipt.setName("OnlyReceipt");
fCheckReceipt.addEventListener(Events.ON_CHECK, this);
fCheckReceipt.setAttribute("zk_component_ID", "Lookup_Criteria_CheckReceipt");
//
fCheckPayment.setLabel(Msg.translate(Env.getCtx(), "OnlyPayment"));
fCheckPayment.setName("OnlyPayment");
fCheckPayment.addEventListener(Events.ON_CHECK, this);
fCheckPayment.setAttribute("zk_component_ID", "Lookup_Criteria_CheckPayment");
//
fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_BPartner_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BPartner_ID"), "", false, false, true);
fBPartner_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
fBPartner_ID.addValueChangeListener(this);
fBankAccount_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_BankAccount_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BankAccount_ID"), "", false, false, true);
fBankAccount_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
fBankAccount_ID.addValueChangeListener(this);
Rows rows = new Rows();
Row row = new Row();
rows.appendChild(row);
row.appendChild(lDocumentNo.rightAlign());
row.appendChild(fDocumentNo);
row.appendChild(fBPartner_ID.getLabel().rightAlign());
row.appendChild(fBPartner_ID.getComponent());
row.appendChild(fCheckReceipt);
row = new Row();
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.appendChild(fCheckPayment);
row = new Row();
rows.appendChild(row);
row.appendCellChild(lAmtFrom.rightAlign(), 3);
hbox = new Hbox();
hbox.appendChild(fAmtFrom);
hbox.appendChild(lAmtTo);
hbox.appendChild(fAmtTo);
row.appendCellChild(hbox, 1);
p_criteriaGrid.appendChild(rows);
super.setSizes();
}
use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.
the class InfoInOutPanel method statInit.
// InfoInOutPanel
/**
* Static Setup - add fields to parameterPanel
*/
private void statInit() {
fDocumentNo.setWidth("100%");
fDocumentNo.addEventListener(Events.ON_CHANGE, this);
fDocumentNo.setAttribute("zk_component_ID", "Lookup_Criteria_DocumentNo");
fDescription.setWidth("100%");
fDescription.addEventListener(Events.ON_CHANGE, this);
fDescription.setAttribute("zk_component_ID", "Lookup_Criteria_Description");
fPOReference.setWidth("100%");
fPOReference.addEventListener(Events.ON_CHANGE, this);
fPOReference.setAttribute("zk_component_ID", "Lookup_Criteria_POReference");
// Format the dates and number boxes
fDateFrom = new Datebox();
fDateFrom.setWidth("97px");
fDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_DateFrom");
fDateFrom.addEventListener(Events.ON_CHANGE, this);
//
fDateTo = new Datebox();
fDateTo.setWidth("97px");
fDateTo.setAttribute("zk_component_ID", "Lookup_Criteria_DateTo");
fDateTo.addEventListener(Events.ON_CHANGE, this);
//
SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
fDateFrom.setFormat(dateFormat.toPattern());
fDateTo.setFormat(dateFormat.toPattern());
fIsSOTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
fIsSOTrx.setName("IsSOTrx");
fIsSOTrx.setAttribute("zk_component_ID", "Lookup_Criteria_IsSoTrx");
fIsSOTrx.addActionListener(this);
fIsSOTrx.setChecked(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));
fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInOut.Table_Name, MInOut.COLUMNNAME_C_BPartner_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BPartner_ID"), "", false, false, true);
fBPartner_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
fBPartner_ID.addValueChangeListener(this);
//
fShipper_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInOut.Table_Name, MInOut.COLUMNNAME_M_Shipper_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "M_Shipper_ID"), "", false, false, true);
fShipper_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_Shipper_ID");
fShipper_ID.addValueChangeListener(this);
Rows rows = new Rows();
Row row = new Row();
rows.appendChild(row);
row.appendCellChild(lDocumentNo.rightAlign());
row.appendCellChild(fDocumentNo);
row.appendCellChild(fBPartner_ID.getLabel().rightAlign());
row.appendCellChild(fBPartner_ID.getComponent());
row.appendCellChild(fIsSOTrx);
row = new Row();
rows.appendChild(row);
row.appendCellChild(lDescription.rightAlign());
row.appendCellChild(fDescription);
row.appendCellChild(lDateFrom.rightAlign());
Hbox hbox = new Hbox();
hbox.appendChild(fDateFrom);
hbox.appendChild(lDateTo);
hbox.appendChild(fDateTo);
row.appendCellChild(hbox, 2);
row = new Row();
rows.appendChild(row);
row.appendCellChild(lPOReference.rightAlign());
row.appendCellChild(fPOReference);
row.appendCellChild(fShipper_ID.getLabel().rightAlign());
row.appendCellChild(fShipper_ID.getComponent());
row.appendCellChild(new Label());
p_criteriaGrid.appendChild(rows);
super.setSizes();
}
use of org.adempiere.webui.editor.WSearchEditor in project adempiere by adempiere.
the class InfoInvoicePanel method initComponents.
private void initComponents() {
lblDocumentNo = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "DocumentNo")));
lblDescription = new Label(Msg.translate(Env.getCtx(), "Description"));
lblDateInvoiced = new Label(Msg.translate(Env.getCtx(), "DateInvoiced"));
lblGrandTotal = new Label(Msg.translate(Env.getCtx(), "GrandTotal"));
//
fDocumentNo = new Textbox();
fDocumentNo.addEventListener(Events.ON_CHANGE, this);
fDocumentNo.setAttribute("zk_component_ID", "Lookup_Criteria_DocumentNo");
fDescription = new Textbox();
fDescription.addEventListener(Events.ON_CHANGE, this);
fDescription.setAttribute("zk_component_ID", "Lookup_Criteria_Description");
// Format the dates and number boxes
fDateFrom = new Datebox();
fDateTo = new Datebox();
fDateFrom.setWidth("97px");
fDateTo.setWidth("97px");
//
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);
//
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 = new NumberBox(false);
fAmtFrom.getDecimalbox().setWidth("90px");
fAmtFrom.getDecimalbox().setFormat(format.toPattern());
fAmtFrom.getDecimalbox().setStyle("text-align:right; " + fAmtFrom.getDecimalbox().getStyle());
fAmtFrom.setAttribute("zk_component_ID", "Lookup_Criteria_AmtFrom");
fAmtFrom.addEventListener(Events.ON_CHANGE, this);
fAmtTo = new NumberBox(false);
fAmtTo.getDecimalbox().setWidth("90px");
fAmtTo.getDecimalbox().setFormat(format.toPattern());
fAmtTo.getDecimalbox().setStyle("text-align:right; " + fAmtTo.getDecimalbox().getStyle());
fAmtTo.setAttribute("zk_component_ID", "Lookup_Criteria_AmtTo");
fAmtTo.addEventListener(Events.ON_CHANGE, this);
//
fIsPaid = new Checkbox();
fIsPaid.setLabel(Msg.translate(Env.getCtx(), "IsPaid"));
fIsPaid.setAttribute("zk_component_ID", "Lookup_Criteria_IsPaid");
fIsPaid.addActionListener(this);
//
fIsSOTrx = new Checkbox();
fIsSOTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
fIsSOTrx.setAttribute("zk_component_ID", "Lookup_Criteria_IsSoTrx");
fIsSOTrx.addActionListener(this);
//
fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInvoice.Table_Name, MInvoice.COLUMNNAME_C_BPartner_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BPartner_ID"), "", false, false, true);
fBPartner_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
fBPartner_ID.addValueChangeListener(this);
//
fOrder_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInvoice.Table_Name, MInvoice.COLUMNNAME_C_Order_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_Order_ID"), "", false, false, true);
fOrder_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Order_ID");
fOrder_ID.addValueChangeListener(this);
}
Aggregations