use of org.adempiere.webui.component.Datebox in project adempiere by adempiere.
the class WCollectDetail method loadCheckPanel.
/**
* Load Check Panel
* @return void
*/
public void loadCheckPanel() {
v_CheckPanel = GridFactory.newGridLayout();
v_CheckPanel.setWidth("100%");
v_CheckPanel.setHeight("95px");
groupPanel.appendChild(v_CheckPanel);
Rows rows = v_CheckPanel.newRows();
Row row = rows.newRow();
fCheckRouteNo = new WPOSTextField(Msg.translate(p_ctx, "RoutingNo"), keyboard);
row.appendChild(fCheckRouteNo);
fCheckRouteNo.addEventListener("onFocus", this);
fCheckRouteNo.setStyle(HEIGHT + WIDTH + FONT_SIZE);
row.appendChild(fCheckRouteNo);
fCheckNo = new WPOSTextField(Msg.translate(p_ctx, "CheckNo"), keyboard);
fCheckNo.addEventListener("onFocus", this);
fCheckNo.setStyle(HEIGHT + WIDTH + FONT_SIZE);
row.appendChild(fCheckNo);
fCheckdate = new Datebox();
fCheckdate.setStyle(HEIGHT + WIDTH + FONT_SIZE);
row = rows.newRow();
fCheckdate.addEventListener("onFocus", this);
row.appendChild(fCheckdate);
}
use of org.adempiere.webui.component.Datebox in project adempiere by adempiere.
the class WQueryOrderHistory method init.
/**
* Set up Panel
*/
protected void init() {
setTitle(Msg.translate(Env.getCtx(), "C_Order_ID"));
Panel panel = new Panel();
setVisible(true);
Panel mainPanel = new Panel();
Grid productLayout = GridFactory.newGridLayout();
Groupbox groupPanel = new Groupbox();
Caption v_TitleBorder = new Caption(Msg.getMsg(ctx, QUERY));
// Set title window
this.setClosable(true);
// add listener on 'ENTER' key
addEventListener(Events.ON_OK, this);
appendChild(panel);
northPanel = new Panel();
mainPanel.appendChild(mainLayout);
groupPanel.appendChild(v_TitleBorder);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
Center center = new Center();
//
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(groupPanel);
groupPanel.appendChild(productLayout);
appendChild(mainPanel);
productLayout.setWidth("100%");
Rows rows = null;
Row row = null;
rows = productLayout.newRows();
row = rows.newRow();
Label labelDocumentNo = new Label(Msg.translate(ctx, DOCUMENTNO));
labelDocumentNo.setStyle(WPOS.FONTSIZESMALL);
row.setHeight("20px");
row.appendChild(labelDocumentNo.rightAlign());
fieldDocumentNo = new WPOSTextField("", posPanel.getKeyboard());
row.appendChild(fieldDocumentNo);
fieldDocumentNo.addEventListener(this);
fieldDocumentNo.setWidth("120px");
fieldDocumentNo.setStyle(WPOS.FONTSIZESMALL);
//
Label labelDateFrom = new Label(Msg.translate(ctx, DATEORDEREDFROM));
labelDateFrom.setStyle(WPOS.FONTSIZESMALL);
row.appendChild(labelDateFrom.rightAlign());
fieldDateFrom = new Datebox();
fieldDateFrom.setValue(Env.getContextAsDate(Env.getCtx(), "#Date"));
fieldDateFrom.addEventListener("onBlur", this);
fieldDateFrom.setStyle(WPOS.FONTSIZESMALL);
row.appendChild(fieldDateFrom);
fieldAllowDate = new Checkbox();
fieldAllowDate.setLabel(Msg.translate(ctx, DATE));
fieldAllowDate.setSelected(false);
row.appendChild(fieldAllowDate);
fieldAllowDate.addActionListener(this);
fieldAllowDate.setStyle(WPOS.FONTSIZESMALL);
row = rows.newRow();
Label labelBPartner = new Label(Msg.translate(ctx, BPARTNERID));
labelBPartner.setStyle(WPOS.FONTSIZESMALL);
row.setHeight("60px");
row.appendChild(labelBPartner.rightAlign());
fieldBPartner = new WPOSTextField("", posPanel.getKeyboard());
row.appendChild(fieldBPartner);
fieldBPartner.addEventListener(this);
fieldBPartner.setWidth("120px");
fieldBPartner.setStyle(WPOS.FONTSIZESMALL);
Label labelDateTo = new Label(Msg.translate(ctx, DATEORDEREDTO));
labelDateTo.setStyle(WPOS.FONTSIZESMALL);
row.appendChild(labelDateTo.rightAlign());
fieldDateTo = new Datebox();
fieldDateTo.setValue(Env.getContextAsDate(Env.getCtx(), "#Date"));
fieldDateTo.addEventListener("onBlur", this);
fieldDateTo.setStyle(WPOS.FONTSIZESMALL);
row.appendChild(fieldDateTo);
fieldProcessed = new Checkbox();
fieldProcessed.setLabel(Msg.translate(ctx, PROCESSED));
fieldProcessed.setSelected(false);
row.appendChild(fieldProcessed);
fieldProcessed.addActionListener(this);
fieldProcessed.setStyle(WPOS.FONTSIZESMALL);
// Center
posTable = ListboxFactory.newDataTable();
posTable.prepareTable(columnInfos, "C_Order", "C_POS_ID = " + posPanel.getC_POS_ID(), false, "C_Order");
enableButtons();
center = new Center();
center.setStyle("border: none");
posTable.setWidth("100%");
posTable.setHeight("99%");
posTable.addActionListener(this);
center.appendChild(posTable);
mainLayout.appendChild(center);
posTable.setClass("Table-OrderLine");
posTable.autoSize();
posTable.addEventListener(Events.ON_DOUBLE_CLICK, this);
refresh();
}
use of org.adempiere.webui.component.Datebox in project adempiere by adempiere.
the class WBrowserListItemRenderer method onEvent.
@Override
public void onEvent(Event event) throws Exception {
int col = -1;
int row = -1;
Object value = null;
TableValueChangeEvent vcEvent = null;
WTableColumn tableColumn;
Component source = event.getTarget();
if (isWithinListCell(source)) {
row = getRowPosition(source);
col = getColumnPosition(source);
tableColumn = m_tableColumns.get(col);
if (source instanceof Checkbox) {
value = Boolean.valueOf(((Checkbox) source).isChecked());
} else if (source instanceof Decimalbox) {
value = ((Decimalbox) source).getValue();
} else if (source instanceof Datebox) {
value = ((Datebox) source).getValue();
} else if (source instanceof Textbox) {
value = ((Textbox) source).getValue();
}
if (value != null) {
vcEvent = new TableValueChangeEvent(source, tableColumn.getHeaderValue().toString(), row, col, value, value);
fireTableValueChange(vcEvent);
}
} else if (event.getTarget() instanceof WBrowserTable && Events.ON_SELECT.equals(event.getName())) {
WBrowserTable table = (WBrowserTable) event.getTarget();
if (table.isCheckmark()) {
int cnt = table.getRowCount();
if (cnt == 0 || !(table.getValueAt(0, 0) instanceof IDColumn))
return;
//update IDColumn
tableColumn = m_tableColumns.get(0);
for (int i = 0; i < cnt; i++) {
IDColumn idcolumn = (IDColumn) table.getValueAt(i, 0);
if (idcolumn != null) {
Listitem item = table.getItemAtIndex(i);
value = item.isSelected();
Boolean old = idcolumn.isSelected();
if (!old.equals(value)) {
vcEvent = new TableValueChangeEvent(source, tableColumn.getHeaderValue().toString(), i, 0, old, value);
fireTableValueChange(vcEvent);
}
}
}
}
}
return;
}
use of org.adempiere.webui.component.Datebox 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.component.Datebox 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();
}
Aggregations