Search in sources :

Example 66 with Row

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

the class WPOS method setMPOS.

//	dynInit
/**
	 * 	Set MPOS
	 *	@return true if found/set
	 */
private void setMPOS() {
    int salesRep_ID = Env.getAD_User_ID(getCtx());
    setPOS(salesRep_ID);
    if (getM_POS() != null) {
        validLocator();
        return;
    }
    int orgId = Env.getAD_Org_ID(getCtx());
    poss = getPOSByOrganization(orgId);
    //	Select POS
    String msg = Msg.getMsg(ctx, "SelectPOS");
    selection = new Window();
    Panel mainPanel = new Panel();
    Panel panel = new Panel();
    selection.setTitle(msg);
    Borderlayout mainLayout = new Borderlayout();
    Grid layout = GridFactory.newGridLayout();
    selection.appendChild(panel);
    selection.setWidth("200px");
    selection.setHeight("140px");
    //	North
    Panel centerPanel = new Panel();
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("100%");
    //
    Center center = new Center();
    center.setStyle("border: none");
    mainLayout.appendChild(center);
    center.appendChild(centerPanel);
    centerPanel.appendChild(layout);
    layout.setWidth("100%");
    layout.setHeight("100%");
    selection.appendChild(mainPanel);
    Rows rows = null;
    Row row = null;
    rows = layout.newRows();
    row = rows.newRow();
    for (MPOS pos : poss) {
        listTerminal.addItem(pos.getKeyNamePair());
    }
    okButton.addActionListener(this);
    cancelButton.addEventListener("onClick", this);
    okButton.setWidth("45px");
    okButton.setHeight("45px");
    cancelButton.setWidth("45px");
    cancelButton.setHeight("45px");
    listTerminal.setHeight("45px");
    listTerminal.setStyle("height:45px;" + WPOS.FONTSIZEMEDIUM);
    row.setSpans("2");
    row.appendChild(listTerminal);
    row.setHeight("45px");
    row = rows.newRow();
    confirm = new ConfirmPanel(true);
    confirm.addActionListener(this);
    confirm.getOKButton().setWidth("55px");
    confirm.getOKButton().setHeight("55px");
    confirm.getButton(ConfirmPanel.A_CANCEL).setWidth("55px");
    confirm.getButton(ConfirmPanel.A_CANCEL).setHeight("55px");
    row.appendChild(confirm);
    row.setHeight("55px");
    AEnv.showWindow(selection);
}
Also used : Window(org.adempiere.webui.component.Window) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) StatusBarPanel(org.adempiere.webui.panel.StatusBarPanel) Center(org.zkoss.zkex.zul.Center) MPOS(org.compiere.model.MPOS) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Grid(org.adempiere.webui.component.Grid) Borderlayout(org.adempiere.webui.component.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 67 with Row

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

the class WPOSKeyboard method init.

/**
	 * 	Initialize
	 * @param startText 
	 * @param POSKeyLayout_ID 
	 */
public void init(int POSKeyLayout_ID) {
    Panel panel = new Panel();
    appendChild(panel);
    //	Content
    Panel mainPanel = new Panel();
    Borderlayout mainLayout = new Borderlayout();
    Grid productLayout = GridFactory.newGridLayout();
    appendChild(panel);
    //	North
    Panel northPanel = new Panel();
    mainPanel.appendChild(mainLayout);
    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(northPanel);
    northPanel.appendChild(productLayout);
    productLayout.setWidth("100%");
    appendChild(mainPanel);
    Rows rows = null;
    Row row = null;
    rows = productLayout.newRows();
    row = rows.newRow();
    String txtCalcId = txtCalc.getId();
    row.appendChild(txtCalc);
    txtCalc.setName("number");
    txtCalc.setWidth("92%");
    WPOSKeyPanel keys = new WPOSKeyPanel(POSKeyLayout_ID, this, txtCalcId, keyBoardType);
    center = new Center();
    center.setStyle("border: none");
    keys.setWidth("100%");
    keys.setHeight("99%");
    center.appendChild(keys);
    mainLayout.appendChild(center);
    South south = new South();
    ConfirmPanel confirm = new ConfirmPanel(true, false, true, false, false, false, false);
    confirm.addActionListener(this);
    south.appendChild(confirm);
    mainLayout.appendChild(south);
}
Also used : ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zkex.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Grid(org.adempiere.webui.component.Grid) South(org.zkoss.zkex.zul.South) North(org.zkoss.zkex.zul.North) Borderlayout(org.adempiere.webui.component.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 68 with Row

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

the class WPOSUserPinDialog method showDialog.

private void showDialog(WPOS pos) {
    passwordField = new WPOSTextField("", pos.getKeyboard());
    passwordField.setStyle("Font-size:medium; font-weight:bold");
    passwordField.addEventListener(this);
    passwordField.addEventListener(Events.ON_OK, this);
    passwordField.setType("password");
    Panel mainPanel = new Panel();
    this.setWidth("200px");
    this.setHeight("100px");
    b_ok.addActionListener(pos);
    b_ok.addEventListener(Events.ON_OK, pos);
    b_cancel.addActionListener(pos);
    Borderlayout mainLayout = new Borderlayout();
    Grid layout = GridFactory.newGridLayout();
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("100%");
    Panel centerPanel = new Panel();
    Center center = new Center();
    center.setStyle("border: none");
    mainLayout.appendChild(center);
    center.appendChild(centerPanel);
    centerPanel.appendChild(layout);
    layout.setWidth("100%");
    layout.setHeight("100%");
    this.appendChild(mainPanel);
    Rows rows = null;
    Row row = null;
    rows = layout.newRows();
    row = rows.newRow();
    Label msg = new Label(Msg.parseTranslation(pos.getCtx(), "@UserPIN@"));
    row.appendChild(msg);
    row = rows.newRow();
    row.appendChild(passwordField);
    row.setSpans("2");
    row = rows.newRow();
    row.appendChild(b_ok);
    row.appendChild(b_cancel);
    b_ok.addActionListener(this);
    b_cancel.addActionListener(this);
    AEnv.showWindow(this);
    pos.validateAndSetUserPin(returnValue);
}
Also used : Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zkex.zul.Center) Grid(org.adempiere.webui.component.Grid) Label(org.adempiere.webui.component.Label) Borderlayout(org.adempiere.webui.component.Borderlayout) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 69 with Row

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

the class WPOSQuantityPanel method init.

@Override
protected void init() {
    Grid LayoutButton = GridFactory.newGridLayout();
    Rows rows = null;
    Row row = null;
    parameterPanel = new Panel();
    parameterPanel.appendChild(LayoutButton);
    LayoutButton.setWidth("100%");
    LayoutButton.setHeight("100%");
    rows = LayoutButton.newRows();
    row = rows.newRow();
    row.setHeight("55px");
    buttonDelete = createButtonAction("Cancel", "Ctrl+F3");
    buttonDelete.setTooltiptext("Ctrl+F3-" + Msg.translate(ctx, "DeleteLine"));
    buttonDelete.addActionListener(this);
    row.appendChild(buttonDelete);
    buttonPlus = createButtonAction("Plus", "Ctrl+1");
    buttonPlus.setTooltiptext("Ctrl+0-" + Msg.translate(ctx, "add"));
    row.appendChild(buttonPlus);
    buttonMinus = createButtonAction("Minus", "Ctrl+0");
    row.appendChild(buttonMinus);
    buttonUp = createButtonAction(ACTION_UP, "Alt+Up");
    buttonUp.setTooltiptext("Alt+Up-" + Msg.translate(ctx, "Previous"));
    row.appendChild(buttonUp);
    buttonDown = createButtonAction(ACTION_DOWN, "Alt+Down");
    buttonDown.setTooltiptext("Alt+Down-" + Msg.translate(ctx, "Next"));
    row.appendChild(buttonDown);
    if (posPanel.isPresentElectronicScales()) {
        buttonScales = createButtonAction("Calculator", "Ctrl+W");
        buttonScales.setTooltiptext("ALT+down-" + Msg.translate(ctx, "Calculator"));
        row.appendChild(buttonScales);
    //			buttonScales.addActionListener(posPanel.getScalesListener());
    }
    Label qtyLabel = new Label(Msg.translate(Env.getCtx(), "QtyOrdered"));
    row.appendChild(qtyLabel);
    fieldQuantity = new POSNumberBox(false);
    row.appendChild(fieldQuantity);
    fieldQuantity.addEventListener(Events.ON_OK, this);
    fieldQuantity.addEventListener(Events.ON_CHANGE, this);
    fieldQuantity.setStyle("display: inline;width:65px;height:30px;Font-size:medium;");
    Label priceLabel = new Label(Msg.translate(Env.getCtx(), "PriceActual"));
    row.appendChild(priceLabel);
    fieldPrice = new POSNumberBox(false);
    DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount, AEnv.getLanguage(Env.getCtx()));
    fieldPrice.getDecimalbox().setFormat(format.toPattern());
    fieldPrice.setTooltiptext(Msg.translate(Env.getCtx(), "PriceActual"));
    row.appendChild(fieldPrice);
    if (!posPanel.isModifyPrice())
        fieldPrice.setEnabled(false);
    else {
        fieldPrice.addEventListener(Events.ON_OK, this);
        fieldPrice.addEventListener(Events.ON_CHANGE, this);
    }
    fieldPrice.setStyle("display: inline;width:70px;height:30px;Font-size:medium;");
    Label priceDiscount = new Label(Msg.translate(Env.getCtx(), "Discount"));
    row.appendChild(priceDiscount);
    fieldDiscountPercentage = new POSNumberBox(false);
    row.appendChild(fieldDiscountPercentage);
    fieldDiscountPercentage.setTooltiptext(Msg.translate(Env.getCtx(), "Discount"));
    if (!posPanel.isModifyPrice())
        fieldDiscountPercentage.setEnabled(false);
    else {
        fieldDiscountPercentage.addEventListener(Events.ON_OK, this);
        fieldDiscountPercentage.addEventListener(Events.ON_CHANGE, this);
    }
    fieldDiscountPercentage.setStyle("display: inline;width:70px;height:30px;Font-size:medium;");
    Keylistener keyListener = new Keylistener();
    fieldPrice.appendChild(keyListener);
    keyListener.setCtrlKeys("@#up@#down^#f3^1^0");
    keyListener.addEventListener(Events.ON_CTRL_KEY, posPanel);
    keyListener.addEventListener(Events.ON_CTRL_KEY, this);
    keyListener.setAutoBlur(false);
    changeStatus(false);
}
Also used : Panel(org.adempiere.webui.component.Panel) Grid(org.adempiere.webui.component.Grid) DecimalFormat(java.text.DecimalFormat) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Keylistener(org.zkforge.keylistener.Keylistener) Rows(org.adempiere.webui.component.Rows)

Example 70 with Row

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

the class WPaySelect method zkInit.

//	init
/**
	 *  Static Init
	 *  @throws Exception
	 */
private void zkInit() throws Exception {
    //
    form.appendChild(mainPanel);
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("99%");
    parameterPanel.appendChild(parameterLayout);
    //
    labelBankAccount.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
    fieldBankAccount.addActionListener(this);
    fieldBankAccount.setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
    fieldBankAccount.setAttribute("zk_component_prefix", "Lookup_");
    fieldBankAccount.setAttribute("IsDynamic", "False");
    fieldBankAccount.setAttribute("fieldName", "fieldBankAccount");
    fieldBankAccount.setWidth("200px");
    //
    labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fieldBPartner.addValueChangeListener(this);
    fieldBPartner.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
    fieldBPartner.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fieldBPartner.getComponent().setAttribute("IsDynamic", "False");
    fieldBPartner.getComponent().setAttribute("fieldName", "fieldBPartner");
    fieldBPartner.getComponent().setWidth("200px");
    //
    bRefresh.addActionListener(this);
    //
    labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
    fieldPayDate.addValueChangeListener(this);
    fieldPayDate.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_PayDate");
    fieldPayDate.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fieldPayDate.getComponent().setAttribute("IsDynamic", "False");
    fieldPayDate.getComponent().setAttribute("fieldName", "fieldPayDate");
    fieldPayDate.getComponent().setWidth("200px");
    //
    labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
    fieldPaymentRule.addActionListener(this);
    fieldPaymentRule.setAttribute("zk_component_ID", "Lookup_Criteria_PaymentRule");
    fieldPaymentRule.setAttribute("zk_component_prefix", "Lookup_");
    fieldPaymentRule.setAttribute("IsDynamic", "False");
    fieldPaymentRule.setAttribute("fieldName", "fieldPaymentRule");
    fieldPaymentRule.setWidth("200px");
    //
    labelDtype.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    fieldDtype.addActionListener(this);
    fieldDtype.setAttribute("zk_component_ID", "Lookup_Criteria_C_DocType_ID");
    fieldDtype.setAttribute("zk_component_prefix", "Lookup_");
    fieldDtype.setAttribute("IsDynamic", "False");
    fieldDtype.setAttribute("fieldName", "fieldDtype");
    //
    labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
    labelBalance.setText("0");
    labelBalance.setAttribute("zk_component_ID", "Lookup_Criteria_CurrentBalance");
    labelBalance.setAttribute("zk_component_prefix", "Lookup_");
    labelBalance.setAttribute("IsDynamic", "False");
    labelBalance.setAttribute("fieldName", "labelBalance");
    //
    onlyDue.setText(Msg.getMsg(Env.getCtx(), "OnlyDue"));
    onlyDue.addActionListener(this);
    onlyDue.setAttribute("zk_component_ID", "Lookup_Criteria_OnlyDue");
    onlyDue.setAttribute("fieldName", "onlyDue");
    onlyDue.setName("OnlyDue");
    onlyDue.setTooltiptext(Msg.getMsg(Env.getCtx(), "OnlyDue"));
    //
    checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
    checkAutoQuery.addActionListener(this);
    checkAutoQuery.setAttribute("zk_component_ID", "Lookup_Criteria_AutoRefresh");
    checkAutoQuery.setName("AutoQuery");
    checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
    //
    dataStatus.setText(" ");
    dataStatus.setPre(true);
    dataStatus.setAttribute("zk_component_ID", "Lookup_Criteria_DataStatus");
    dataStatus.setAttribute("zk_component_prefix", "Lookup_");
    dataStatus.setAttribute("IsDynamic", "False");
    dataStatus.setAttribute("fieldName", "dataStatus");
    //
    bGenerate.addActionListener(this);
    bCancel.addActionListener(this);
    //
    North north = new North();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);
    //
    Rows rows = parameterLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(labelBankAccount.rightAlign());
    row.appendChild(fieldBankAccount);
    row.appendChild(labelBankBalance.rightAlign());
    Panel balancePanel = new Panel();
    balancePanel.appendChild(labelCurrency);
    balancePanel.appendChild(labelBalance);
    row.appendChild(balancePanel);
    row.appendChild(new Space());
    //
    row = rows.newRow();
    row.appendChild(labelBPartner.rightAlign());
    row.appendChild(fieldBPartner.getComponent());
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(new Space());
    //
    row = rows.newRow();
    row.appendChild(labelDtype.rightAlign());
    row.appendChild(fieldDtype);
    row.appendChild(labelPaymentRule.rightAlign());
    row.appendChild(fieldPaymentRule);
    row.appendChild(checkAutoQuery);
    //
    row = rows.newRow();
    row.appendChild(labelPayDate.rightAlign());
    row.appendChild(fieldPayDate.getComponent());
    row.appendChild(new Space());
    row.appendChild(onlyDue);
    row.appendChild(bRefresh);
    //
    commandPanel.addButton(bGenerate);
    commandPanel.getButton(ConfirmPanel.A_OK).setVisible(false);
    //
    southPanel = new Panel();
    southPanel.appendChild(dataStatus);
    southPanel.appendChild(new Separator());
    southPanel.appendChild(commandPanel);
    //
    South south = new South();
    south.setStyle("border: none");
    mainLayout.appendChild(south);
    south.appendChild(southPanel);
    //
    Center center = new Center();
    mainLayout.appendChild(center);
    center.appendChild(miniTable);
}
Also used : Space(org.zkoss.zul.Space) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Center(org.zkoss.zul.Center) South(org.zkoss.zul.South) North(org.zkoss.zul.North) Row(org.adempiere.webui.component.Row) Separator(org.zkoss.zul.Separator) Rows(org.adempiere.webui.component.Rows)

Aggregations

Row (org.adempiere.webui.component.Row)79 Rows (org.adempiere.webui.component.Rows)69 Label (org.adempiere.webui.component.Label)29 Grid (org.adempiere.webui.component.Grid)24 Panel (org.adempiere.webui.component.Panel)20 Div (org.zkoss.zul.Div)18 Center (org.zkoss.zul.Center)15 Hbox (org.zkoss.zul.Hbox)15 Space (org.zkoss.zul.Space)14 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)12 Center (org.zkoss.zkex.zul.Center)11 Separator (org.zkoss.zul.Separator)11 North (org.zkoss.zkex.zul.North)10 Borderlayout (org.zkoss.zul.Borderlayout)9 North (org.zkoss.zul.North)9 South (org.zkoss.zkex.zul.South)8 South (org.zkoss.zul.South)8 Caption (org.zkoss.zul.Caption)6 Listbox (org.adempiere.webui.component.Listbox)5 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)5