Search in sources :

Example 1 with Datebox

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);
}
Also used : Datebox(org.adempiere.webui.component.Datebox) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 2 with Datebox

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();
}
Also used : Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zkex.zul.Center) WPOSTextField(org.adempiere.pos.WPOSTextField) Datebox(org.adempiere.webui.component.Datebox) Groupbox(org.zkoss.zul.Groupbox) Checkbox(org.adempiere.webui.component.Checkbox) Grid(org.adempiere.webui.component.Grid) Label(org.adempiere.webui.component.Label) North(org.zkoss.zkex.zul.North) Row(org.adempiere.webui.component.Row) Caption(org.zkoss.zul.Caption) Rows(org.adempiere.webui.component.Rows)

Example 3 with Datebox

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;
}
Also used : Datebox(org.adempiere.webui.component.Datebox) WTableColumn(org.adempiere.webui.component.WTableColumn) Textbox(org.adempiere.webui.component.Textbox) Listitem(org.zkoss.zul.Listitem) IDColumn(org.compiere.minigrid.IDColumn) Decimalbox(org.zkoss.zul.Decimalbox) Checkbox(org.adempiere.webui.component.Checkbox) Component(org.zkoss.zk.ui.Component) TableValueChangeEvent(org.adempiere.webui.event.TableValueChangeEvent)

Example 4 with Datebox

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();
}
Also used : Hbox(org.zkoss.zul.Hbox) Datebox(org.adempiere.webui.component.Datebox) DecimalFormat(java.text.DecimalFormat) Textbox(org.adempiere.webui.component.Textbox) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) NumberBox(org.adempiere.webui.component.NumberBox) Row(org.adempiere.webui.component.Row) SimpleDateFormat(java.text.SimpleDateFormat) Rows(org.adempiere.webui.component.Rows)

Example 5 with Datebox

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();
}
Also used : Hbox(org.zkoss.zul.Hbox) Datebox(org.adempiere.webui.component.Datebox) Label(org.adempiere.webui.component.Label) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Row(org.adempiere.webui.component.Row) SimpleDateFormat(java.text.SimpleDateFormat) Rows(org.adempiere.webui.component.Rows)

Aggregations

Datebox (org.adempiere.webui.component.Datebox)8 SimpleDateFormat (java.text.SimpleDateFormat)5 Checkbox (org.adempiere.webui.component.Checkbox)5 Textbox (org.adempiere.webui.component.Textbox)5 DecimalFormat (java.text.DecimalFormat)4 Label (org.adempiere.webui.component.Label)4 NumberBox (org.adempiere.webui.component.NumberBox)4 Row (org.adempiere.webui.component.Row)4 Rows (org.adempiere.webui.component.Rows)4 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)4 IDColumn (org.compiere.minigrid.IDColumn)2 Component (org.zkoss.zk.ui.Component)2 Hbox (org.zkoss.zul.Hbox)2 BigDecimal (java.math.BigDecimal)1 MBrowseField (org.adempiere.model.MBrowseField)1 WPOSTextField (org.adempiere.pos.WPOSTextField)1 Button (org.adempiere.webui.component.Button)1 Combobox (org.adempiere.webui.component.Combobox)1 Grid (org.adempiere.webui.component.Grid)1 ListCell (org.adempiere.webui.component.ListCell)1