Search in sources :

Example 16 with ConfirmPanel

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

the class WCollect method zkInit.

/**
	 * Instance Window and fill fields
	 * @return void
	 */
private void zkInit() {
    //		
    mainPanel = new Panel();
    Borderlayout mainLayout = new Borderlayout();
    layout = GridFactory.newGridLayout();
    eastlayout = GridFactory.newGridLayout();
    //	Panels
    centerPanel = new Panel();
    Panel eastPanel = new Panel();
    mainPanel.appendChild(mainLayout);
    mainLayout.setHeight("100%");
    mainLayout.setWidth("100%");
    //
    north = new North();
    north.setStyle("border: none; ");
    mainLayout.appendChild(north);
    north.appendChild(eastPanel);
    eastPanel.appendChild(eastlayout);
    eastlayout.setWidth("100%");
    eastlayout.setHeight("100%");
    rows = eastlayout.newRows();
    row = rows.newRow();
    row.appendChild(new Space());
    Label fsLabel = new Label(Msg.translate(p_ctx, "PayAmt") + ":");
    fsLabel.setStyle(FONT_SIZE + FONT_BOLD);
    fPayAmt = new Label();
    //		fPayAmt.setText(getPrePayAmt().toString());
    row.appendChild(fsLabel.rightAlign());
    row.appendChild(fPayAmt.rightAlign());
    fPayAmt.setStyle(FONT_SIZE);
    row = rows.newRow();
    row.appendChild(new Space());
    //	Add Payment Amount
    Label lOpenAmt = new Label(Msg.translate(p_ctx, "OpenAmt") + ":");
    lOpenAmt.setStyle(FONT_SIZE + FONT_BOLD);
    row.appendChild(lOpenAmt.rightAlign());
    fOpenAmt = new Label();
    fOpenAmt.setStyle(FONT_SIZE);
    row.appendChild(fOpenAmt.rightAlign());
    fReturnAmt = new Label();
    lReturnAmt = new Label(Msg.translate(p_ctx, "AmountReturned") + ":");
    lReturnAmt.setStyle(FONT_SIZE + FONT_BOLD);
    fReturnAmt.setStyle(FONT_SIZE);
    row = rows.newRow();
    row.appendChild(new Space());
    fReturnAmt = new Label();
    lReturnAmt = new Label(Msg.translate(p_ctx, "AmountReturned") + ":");
    lReturnAmt.setStyle(FONT_SIZE + FONT_BOLD);
    fReturnAmt.setStyle(FONT_SIZE);
    row.appendChild(lReturnAmt.rightAlign());
    row.appendChild(fReturnAmt.rightAlign());
    fReturnAmt.addEventListener("onFocus", this);
    row = rows.newRow();
    row.appendChild(new Space());
    fsPaidAmtLabel = new Label(Msg.translate(p_ctx, "PaidAmt") + ":");
    fsPaidAmtLabel.setStyle(FONT_SIZE + FONT_BOLD);
    fPaidAmt = new Label();
    row.appendChild(fsPaidAmtLabel.rightAlign());
    row.appendChild(fPaidAmt.rightAlign());
    fPaidAmt.setStyle(FONT_SIZE);
    // Button Plus
    bPlus = createButtonAction("Plus", KeyStroke.getKeyStroke(KeyEvent.VK_F3, Event.F3));
    row = rows.newRow();
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(bPlus);
    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("60px");
    Center center = new Center();
    center.setStyle("border: none; overflow-y:auto;overflow-x:hidden;");
    mainLayout.appendChild(center);
    center.appendChild(centerPanel);
    centerPanel.appendChild(layout);
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setStyle("overflow:auto;");
    rows = layout.newRows();
    row = rows.newRow();
    row.setWidth("100%");
    // Completed Standard Order: only prepayment possible 
    if (posPanel.getTotalLines().compareTo(Env.ZERO) == 1 && posPanel.isCompleted() && posPanel.isStandardOrder()) {
    //fIsPrePayOrder.setEnabled(false);
    //			fIsCreditOrder.setEnabled(false);
    //fIsPrePayOrder.setSelected(true);
    } else // Not completed Order 
    if (posPanel.getTotalLines().compareTo(Env.ZERO) == 1 && !posPanel.isCompleted()) {
        if (posPanel.isStandardOrder()) /*|| pos.isWarehouseOrder()*/
        {
        // Standard Order or Warehouse Order: no Credit Order, no prepayment
        //fIsPrePayOrder.setEnabled(false);
        //fIsPrePayOrder.setSelected(false);
        //				fIsCreditOrder.setEnabled(false);
        //				fIsCreditOrder.setSelected(false);
        } else {
        //fIsPrePayOrder.setEnabled(true);
        //				fIsCreditOrder.setEnabled(true);
        }
    } else {
    //fIsPrePayOrder.setEnabled(false);
    //			fIsCreditOrder.setEnabled(false);
    //			if(posPanel.isCompleted() &&
    //				posPanel.getM_Order().isInvoiced()  &&
    //				posPanel.getOpenAmt().compareTo(Env.ZERO)==1) {
    //				fIsCreditOrder.setSelected(true);
    //			}
    }
}
Also used : Space(org.zkoss.zul.Space) Panel(org.adempiere.webui.component.Panel) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Center(org.zkoss.zkex.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Label(org.adempiere.webui.component.Label) North(org.zkoss.zkex.zul.North) Borderlayout(org.adempiere.webui.component.Borderlayout)

Example 17 with ConfirmPanel

use of org.adempiere.webui.component.ConfirmPanel 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 18 with ConfirmPanel

use of org.adempiere.webui.component.ConfirmPanel 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 19 with ConfirmPanel

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

the class WCreateFromWindow method zkInit.

protected void zkInit() throws Exception {
    Borderlayout contentPane = new Borderlayout();
    appendChild(contentPane);
    North north = new North();
    contentPane.appendChild(north);
    north.appendChild(parameterPanel);
    Center center = new Center();
    contentPane.appendChild(center);
    center.appendChild(dataTable);
    WAppsAction selectAllAction = new WAppsAction(SELECT_ALL, null, null);
    Button selectAllButton = selectAllAction.getButton();
    confirmPanel.addComponentsLeft(selectAllButton);
    selectAllButton.addActionListener(this);
    South south = new South();
    contentPane.appendChild(south);
    Panel southPanel = new Panel();
    south.appendChild(southPanel);
    southPanel.appendChild(new Separator());
    southPanel.appendChild(confirmPanel);
    southPanel.appendChild(new Separator());
    southPanel.appendChild(statusBar);
    setWidth("750px");
    setHeight("550px");
    setSizable(true);
    setBorder("normal");
    contentPane.setWidth("100%");
    contentPane.setHeight("100%");
}
Also used : ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) StatusBarPanel(org.adempiere.webui.panel.StatusBarPanel) Panel(org.adempiere.webui.component.Panel) Center(org.zkoss.zul.Center) Button(org.adempiere.webui.component.Button) South(org.zkoss.zul.South) North(org.zkoss.zul.North) Borderlayout(org.zkoss.zul.Borderlayout) WAppsAction(org.adempiere.webui.component.WAppsAction) Separator(org.zkoss.zul.Separator)

Example 20 with ConfirmPanel

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

the class WDeleteEntity method zkInit.

private void zkInit() throws Exception {
    //Form Init()
    form.appendChild(mainLayout);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    clientLabel.setText(Msg.getElement(Env.getCtx(), "AD_Client_ID"));
    tableLabel.setText(Msg.getElement(Env.getCtx(), "AD_Table_ID"));
    dryRun = new Checkbox(Msg.getMsg(Env.getCtx(), "DryRun"));
    dryRun.setChecked(true);
    ConfirmPanel panel = new ConfirmPanel(false, false, false, false, false, false, false);
    bRefresh = panel.createButton(ConfirmPanel.A_REFRESH);
    bRefresh.addActionListener(this);
    //	
    parameterPanel.appendChild(parameterLayout);
    North north = new North();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);
    Rows rows = null;
    Row row = null;
    parameterLayout.setWidth("100%");
    rows = parameterLayout.newRows();
    row = rows.newRow();
    row.appendChild(clientLabel.rightAlign());
    row.appendChild(clientPick);
    row.appendChild(tableLabel.rightAlign());
    row.appendChild(tablePick);
    //	For Button
    row = rows.newRow();
    row.appendChild(new Hbox());
    row.appendChild(dryRun);
    row.appendChild(new Hbox());
    row.appendChild(bRefresh);
    //	
    centerPanel.appendChild(centerLayout);
    centerLayout.setWidth("100%");
    Center center = new Center();
    mainLayout.appendChild(center);
    center.setStyle("border: none");
    center.appendChild(centerPanel);
    tree = new Tree();
    treeCols = new Treecols();
    treeCol = new Treecol("");
    treeCol2 = new Treecol();
    centerPanel.appendChild(tree);
    treeCols.appendChild(treeCol);
    treeCols.appendChild(treeCol2);
    tree.appendChild(treeCols);
    center.setFlex(true);
    center.setAutoscroll(true);
    South south = new South();
    south.appendChild(southPanel);
    southPanel.appendChild(southLayout);
    southPanel.setWidth("100%");
    mainLayout.appendChild(south);
    Rows rows2 = southLayout.newRows();
    Row south_row = rows2.newRow();
    south_row.appendChild(confirmPanel);
    confirmPanel.addActionListener(this);
}
Also used : Treecol(org.zkoss.zul.Treecol) Hbox(org.zkoss.zul.Hbox) Treecols(org.zkoss.zul.Treecols) Center(org.zkoss.zkex.zul.Center) ConfirmPanel(org.adempiere.webui.component.ConfirmPanel) Checkbox(org.zkoss.zul.Checkbox) South(org.zkoss.zkex.zul.South) Tree(org.zkoss.zul.Tree) North(org.zkoss.zkex.zul.North) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Aggregations

ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)22 Center (org.zkoss.zkex.zul.Center)9 Rows (org.adempiere.webui.component.Rows)8 North (org.zkoss.zkex.zul.North)8 Panel (org.adempiere.webui.component.Panel)7 Row (org.adempiere.webui.component.Row)7 Div (org.zkoss.zul.Div)7 Label (org.adempiere.webui.component.Label)6 South (org.zkoss.zkex.zul.South)6 South (org.zkoss.zul.South)6 Grid (org.adempiere.webui.component.Grid)5 Borderlayout (org.zkoss.zul.Borderlayout)5 Center (org.zkoss.zul.Center)5 North (org.zkoss.zul.North)5 Separator (org.zkoss.zul.Separator)5 Borderlayout (org.adempiere.webui.component.Borderlayout)3 Button (org.adempiere.webui.component.Button)3 WAppsAction (org.adempiere.webui.component.WAppsAction)3 StatusBarPanel (org.adempiere.webui.panel.StatusBarPanel)3 Space (org.zkoss.zul.Space)3