Search in sources :

Example 1 with WListbox

use of org.adempiere.webui.component.WListbox in project adempiere by adempiere.

the class WPOSQuery method initMainPanel.

/**
	 * Init Main Panel
	 * @return void
	 */
private void initMainPanel() {
    //	Instance Panel
    //
    Panel buttonsPanel = new Panel();
    Rows rows = null;
    Row row = null;
    South north = new South();
    northPanel = new Panel();
    mainLayout = new Borderlayout();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(northPanel);
    Grid productLayout = GridFactory.newGridLayout();
    northPanel.appendChild(productLayout);
    rows = productLayout.newRows();
    row = rows.newRow();
    buttonsPanel.setAlign("Center");
    row.setHeight("65px");
    row.setSpans("6");
    buttonNew = createButtonAction("New", KeyStroke.getKeyStroke(KeyEvent.VK_N, 0));
    buttonNew.setId("New");
    buttonsPanel.appendChild(buttonNew);
    buttonNew.addActionListener(this);
    buttonEdit = createButtonAction("Edit", KeyStroke.getKeyStroke(KeyEvent.VK_N, 0));
    buttonEdit.setId("Edit");
    buttonsPanel.appendChild(buttonEdit);
    buttonEdit.addActionListener(this);
    buttonReset = createButtonAction("Reset", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
    buttonsPanel.appendChild(buttonReset);
    buttonReset.setId("Reset");
    buttonRefresh = createButtonAction("Refresh", KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
    buttonsPanel.appendChild(buttonRefresh);
    buttonRefresh.setId("Refresh");
    buttonOk = createButtonAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
    buttonsPanel.appendChild(buttonOk);
    buttonOk.setId("Ok");
    buttonCancel = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));
    buttonsPanel.appendChild(buttonCancel);
    buttonCancel.setId("Cancel");
    buttonOk.setTooltiptext(Msg.translate(ctx, "Ok"));
    buttonCancel.setTooltiptext(Msg.translate(ctx, "Cancel"));
    buttonOk.setTooltiptext(Msg.translate(ctx, "Ok"));
    buttonCancel.setTooltiptext(Msg.translate(ctx, "Cancel"));
    buttonNew.setTooltiptext(Msg.translate(ctx, "New"));
    buttonEdit.setTooltiptext(Msg.translate(ctx, "Edit"));
    buttonRefresh.setTooltiptext(Msg.translate(ctx, "Refresh"));
    row.appendChild(buttonsPanel);
    //	Center
    posTable = new WListbox();
    posTable.addActionListener(this);
    //	Visible New
    buttonNew.setVisible(false);
    buttonEdit.setVisible(false);
    buttonEdit.setEnabled(false);
}
Also used : ConfirmPanel(org.compiere.apps.ConfirmPanel) Panel(org.adempiere.webui.component.Panel) WListbox(org.adempiere.webui.component.WListbox) Grid(org.adempiere.webui.component.Grid) South(org.zkoss.zkex.zul.South) Row(org.adempiere.webui.component.Row) Borderlayout(org.adempiere.webui.component.Borderlayout) Rows(org.adempiere.webui.component.Rows)

Example 2 with WListbox

use of org.adempiere.webui.component.WListbox in project adempiere by adempiere.

the class WMatch method onEvent.

//	dispose
/**************************************************************************
	 *  Action Listener
	 *  @param e event
	 */
public void onEvent(Event e) {
    Integer product = onlyProduct.getValue() != null ? (Integer) onlyProduct.getValue() : null;
    Integer vendor = onlyVendor.getValue() != null ? (Integer) onlyVendor.getValue() : null;
    Timestamp from = dateFrom.getValue() != null ? (Timestamp) dateFrom.getValue() : null;
    Timestamp to = dateTo.getValue() != null ? (Timestamp) dateTo.getValue() : null;
    if (e.getTarget() == matchFrom) {
        //cmd_matchFrom((String)matchFrom.getSelectedItem().getLabel());
        String selection = (String) matchFrom.getSelectedItem().getValue();
        SimpleListModel model = new SimpleListModel(cmd_matchFrom((String) matchFrom.getSelectedItem().getLabel()));
        matchTo.setItemRenderer(model);
        matchTo.setModel(model);
        //  Set Title
        xMatchedBorder.setValue(selection);
        //  Reset Table
        xMatchedTable.setRowCount(0);
        //  sync To
        matchTo.setSelectedIndex(0);
        cmd_matchTo();
    } else if (e.getTarget() == matchTo)
        cmd_matchTo();
    else if (e.getTarget() == bSearch) {
        //cmd_search();
        xMatchedTable = (WListbox) cmd_search(xMatchedTable, matchFrom.getSelectedIndex(), (String) matchTo.getSelectedItem().getLabel(), product, vendor, from, to, matchMode.getSelectedIndex() == MODE_MATCHED);
        xMatched.setValue(Env.ZERO);
        //  Status Info
        statusBar.setStatusLine(matchFrom.getSelectedItem().getLabel() + "# = " + xMatchedTable.getRowCount(), xMatchedTable.getRowCount() == 0);
        statusBar.setStatusDB("0");
        cmd_searchTo();
    } else if (e.getTarget() == bProcess) {
        //cmd_process();
        cmd_process(xMatchedTable, xMatchedToTable, matchMode.getSelectedIndex(), matchFrom.getSelectedIndex(), matchTo.getSelectedItem(), m_xMatched);
        xMatchedTable = (WListbox) cmd_search(xMatchedTable, matchFrom.getSelectedIndex(), (String) matchTo.getSelectedItem().getLabel(), product, vendor, from, to, matchMode.getSelectedIndex() == MODE_MATCHED);
        xMatched.setValue(Env.ZERO);
        //  Status Info
        statusBar.setStatusLine(matchFrom.getSelectedItem().getLabel() + "# = " + xMatchedTable.getRowCount(), xMatchedTable.getRowCount() == 0);
        statusBar.setStatusDB("0");
        cmd_searchTo();
    } else if (e.getTarget() == sameBPartner || e.getTarget() == sameProduct || e.getTarget() == sameQty)
        cmd_searchTo();
    else if (AEnv.contains(xMatchedTable, e.getTarget()))
        cmd_searchTo();
}
Also used : WListbox(org.adempiere.webui.component.WListbox) SimpleListModel(org.adempiere.webui.component.SimpleListModel) Timestamp(java.sql.Timestamp)

Example 3 with WListbox

use of org.adempiere.webui.component.WListbox in project adempiere by adempiere.

the class InfoInvoicePanel method statInit.

private void statInit() {
    initComponents();
    fDocumentNo.setWidth("100%");
    fDescription.setWidth("100%");
    fDateFrom.setWidth("165px");
    fDateTo.setWidth("165px");
    fAmtFrom.getDecimalbox().setWidth("155px");
    fAmtTo.getDecimalbox().setWidth("155px");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendCellChild(lblDocumentNo.rightAlign());
    row.appendCellChild(fDocumentNo);
    row.appendCellChild(fBPartner_ID.getLabel().rightAlign());
    row.appendCellChild(fBPartner_ID.getComponent());
    row.appendCellChild(fIsSOTrx);
    row.appendCellChild(fIsPaid);
    row = new Row();
    rows.appendChild(row);
    row.appendCellChild(lblDescription.rightAlign());
    row.appendCellChild(fDescription);
    row.appendCellChild(lblDateInvoiced.rightAlign());
    Hbox hbox = new Hbox();
    hbox.appendChild(fDateFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(fDateTo);
    row.appendCellChild(hbox, 3);
    row = new Row();
    rows.appendChild(row);
    row.appendCellChild(fOrder_ID.getLabel().rightAlign());
    row.appendCellChild(fOrder_ID.getComponent());
    row.appendCellChild(lblGrandTotal.rightAlign());
    hbox = new Hbox();
    hbox.appendChild(fAmtFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(fAmtTo);
    row.appendCellChild(hbox, 3);
    p_criteriaGrid.appendChild(rows);
    scheduleTbl = new WListbox();
    m_sqlSchedule = scheduleTbl.prepareTable(s_subLayout, s_subFrom, s_subWhere, false, "i");
    scheduleTbl.setMultiSelection(false);
    scheduleTbl.autoSize();
    scheduleTbl.setAttribute("zk_component_ID", "Lookup_Data_Schedule");
    scheduleTbl.setShowTotals(true);
    p_centerSouth.appendChild(scheduleTbl);
    p_centerSouth.setTitle(Msg.translate(Env.getCtx(), "C_InvoicePaySchedule_ID"));
    p_centerSouth.setTooltiptext(Msg.translate(Env.getCtx(), "C_InvoicePaySchedule_ID"));
    super.setSizes();
}
Also used : Hbox(org.zkoss.zul.Hbox) WListbox(org.adempiere.webui.component.WListbox) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Aggregations

WListbox (org.adempiere.webui.component.WListbox)3 Row (org.adempiere.webui.component.Row)2 Rows (org.adempiere.webui.component.Rows)2 Timestamp (java.sql.Timestamp)1 Borderlayout (org.adempiere.webui.component.Borderlayout)1 Grid (org.adempiere.webui.component.Grid)1 Label (org.adempiere.webui.component.Label)1 Panel (org.adempiere.webui.component.Panel)1 SimpleListModel (org.adempiere.webui.component.SimpleListModel)1 ConfirmPanel (org.compiere.apps.ConfirmPanel)1 South (org.zkoss.zkex.zul.South)1 Hbox (org.zkoss.zul.Hbox)1