Search in sources :

Example 21 with Row

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

the class InfoBPartnerPanel method statInit.

private void statInit() {
    initComponents();
    fieldValue.setWidth("100%");
    fieldContact.setWidth("100%");
    fieldPhone.setWidth("100%");
    fieldName.setWidth("100%");
    fieldEMail.setWidth("100%");
    fieldPostal.setWidth("100%");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(labelValue.rightAlign());
    row.appendChild(fieldValue);
    row.appendChild(labelContact.rightAlign());
    row.appendChild(fieldContact);
    row.appendChild(labelPhone.rightAlign());
    row.appendChild(fieldPhone);
    row.appendChild(checkCustomer);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(labelName.rightAlign());
    row.appendChild(fieldName);
    row.appendChild(labelEMail.rightAlign());
    row.appendChild(fieldEMail);
    row.appendChild(labelPostal.rightAlign());
    row.appendChild(fieldPostal);
    row.appendChild(checkAND);
    statusBar.setEastVisibility(false);
    //  Contact Tab
    ColumnInfo[] s_layoutContact = new ColumnInfo[] { new ColumnInfo(" ", "AD_User_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_Greeting_ID"), "(SELECT g.Greeting from C_Greeting g WHERE g.C_Greeting_ID = AD_User.C_Greeting_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Title"), "Title", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_Location_ID"), "(SELECT a.Name from C_BPartner_Location a WHERE AD_User.C_BPartner_Location_ID=a.C_BPartner_Location_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone"), "Phone", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone2"), "Phone2", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Fax"), "Fax", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "EMail"), "EMail", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "LastContact"), "LastContact", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "LastResult"), "LastResult", String.class) };
    //  From Clause
    String s_sqlFrom = "AD_User";
    //  Where Clause					
    String s_sqlWhere = "C_BPartner_ID = ?  and IsActive = 'Y'";
    m_sqlContact = contactTbl.prepareTable(s_layoutContact, s_sqlFrom, s_sqlWhere, false, "AD_User");
    contactTbl.setMultiSelection(false);
    contactTbl.autoSize();
    contactTbl.getModel().addTableModelListener(this);
    contactTbl.setAttribute("zk_component_ID", "Lookup_Data_Contact");
    //  Location Tab
    ColumnInfo[] s_layoutAddress = new ColumnInfo[] { new ColumnInfo(" ", "l.C_BPartner_Location_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "l.Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone"), "l.Phone", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Phone2"), "l.Phone2", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Fax"), "l.Fax", String.class), // Replaced with parsed value
    new ColumnInfo(Msg.translate(Env.getCtx(), "Address"), "a.Address1", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsShipTo"), "l.IsShipTo", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsBillTo"), "l.IsBillTo", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsRemitTo"), "l.IsRemitTo", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsPayFrom"), "l.IsPayFrom", Boolean.class) };
    ADDRESS_INDEX = 5;
    /**	From Clause							*/
    String s_locationFrom = "C_BPartner_Location l" + " LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID)";
    /** Where Clause						*/
    String s_locationWhere = "l.C_BPartner_ID = ? and l.IsActive = 'Y'";
    m_sqlAddress = addressTbl.prepareTable(s_layoutAddress, s_locationFrom, s_locationWhere, false, "l");
    addressTbl.setMultiSelection(false);
    addressTbl.autoSize();
    addressTbl.getModel().addTableModelListener(this);
    addressTbl.setAttribute("zk_component_ID", "Lookup_Data_Address");
    //
    detailTabBox.setHeight("100%");
    Tabpanels tabPanels = new Tabpanels();
    detailTabBox.appendChild(tabPanels);
    Tabs tabs = new Tabs();
    detailTabBox.appendChild(tabs);
    Tab tab = new Tab(Util.cleanAmp(Msg.translate(Env.getCtx(), "Contact")));
    tab.addEventListener(Events.ON_SELECT, this);
    tabs.appendChild(tab);
    Tabpanel desktopTabPanel = new Tabpanel();
    desktopTabPanel.setHeight("100%");
    desktopTabPanel.appendChild(contactTbl);
    tabPanels.appendChild(desktopTabPanel);
    tab = new Tab(Msg.translate(Env.getCtx(), "Location"));
    tab.addEventListener(Events.ON_SELECT, this);
    tabs.appendChild(tab);
    desktopTabPanel = new Tabpanel();
    desktopTabPanel.setHeight("100%");
    desktopTabPanel.appendChild(addressTbl);
    tabPanels.appendChild(desktopTabPanel);
    tabs.setAttribute("zk_component_ID", "Subordinate_Tabs");
    Borderlayout southSP = new Borderlayout();
    Center center = new Center();
    North north = new North();
    center.appendChild(detailTabBox);
    southSP.appendChild(north);
    southSP.appendChild(center);
    p_centerSouth.setTitle(Msg.translate(Env.getCtx(), "ContactAndAddress"));
    p_centerSouth.setTooltiptext(Msg.translate(Env.getCtx(), "ContactAndAddress"));
    p_centerSouth.appendChild(southSP);
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
    contactTbl.addActionListener(new EventListener<Event>() {

        public void onEvent(Event event) throws Exception {
            int leadRowKey = 0;
            if (contactTbl != null || contactTbl.getRowCount() > 0)
                leadRowKey = contactTbl.getLeadRowKey();
            if (m_AD_User_ID != leadRowKey) {
                //  From the contact table
                m_AD_User_ID = leadRowKey;
            }
        }
    });
    addressTbl.addActionListener(new EventListener<Event>() {

        public void onEvent(Event event) throws Exception {
            int leadRowKey = 0;
            if (addressTbl != null || addressTbl.getRowCount() > 0)
                leadRowKey = addressTbl.getLeadRowKey();
            if (m_C_BPartner_Location_ID != leadRowKey) {
                //  From the main table
                m_C_BPartner_Location_ID = leadRowKey;
            }
        }
    });
}
Also used : Center(org.zkoss.zul.Center) ColumnInfo(org.compiere.minigrid.ColumnInfo) Borderlayout(org.zkoss.zul.Borderlayout) SQLException(java.sql.SQLException) Tab(org.adempiere.webui.component.Tab) Tabpanels(org.adempiere.webui.component.Tabpanels) Tabs(org.adempiere.webui.component.Tabs) Event(org.zkoss.zk.ui.event.Event) North(org.zkoss.zul.North) Row(org.adempiere.webui.component.Row) Tabpanel(org.adempiere.webui.component.Tabpanel) Rows(org.adempiere.webui.component.Rows)

Example 22 with Row

use of org.adempiere.webui.component.Row 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)

Example 23 with Row

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

the class InfoOrderPanel method statInit.

public void statInit() {
    initComponents();
    fDocumentNo.setWidth("100%");
    fDescription.setWidth("100%");
    fPOReference.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 = new Row();
    rows.appendChild(row);
    row.appendCellChild(lblDescription.rightAlign());
    row.appendCellChild(fDescription);
    row.appendCellChild(lblDateOrdered.rightAlign());
    Hbox hbox = new Hbox();
    hbox.appendChild(fDateFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(fDateTo);
    hbox.appendChild(fIsDelivered);
    row.appendCellChild(hbox, 2);
    row = new Row();
    rows.appendChild(row);
    row.appendCellChild(lblOrderRef.rightAlign());
    row.appendCellChild(fPOReference);
    row.appendCellChild(lblGrandTotal.rightAlign());
    hbox = new Hbox();
    hbox.appendChild(fAmtFrom);
    hbox.appendChild(new Label("-"));
    hbox.appendChild(fAmtTo);
    row.appendCellChild(hbox, 2);
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
}
Also used : Hbox(org.zkoss.zul.Hbox) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 24 with Row

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

the class WAttributeGrid method createGrid.

/**
	 * 	Create Grid
	 */
private void createGrid() {
    if (attributeCombo1 == null || m_setting)
        //	init
        return;
    Object attr1 = attributeCombo1.getSelectedItem().getValue();
    Object attr2 = attributeCombo2.getSelectedItem().getValue();
    if (attr1.equals(attr2)) {
        FDialog.warn(m_WindowNo, "Same Attribute Selected", getTitle());
        log.warning("Same Attribute Selected");
        tabbox.setSelectedIndex(0);
        return;
    }
    m_setting = true;
    m_M_PriceList_Version_ID = 0;
    ListItem pl = pickPriceList.getSelectedItem();
    if (pl != null)
        m_M_PriceList_Version_ID = Integer.valueOf(pl.getValue().toString());
    m_M_Warehouse_ID = 0;
    ListItem wh = pickWarehouse.getSelectedItem();
    if (wh != null)
        m_M_Warehouse_ID = Integer.valueOf(wh.getValue().toString());
    //	x dimension
    int noOfCols = 2;
    int indexAttr1 = 0;
    MAttributeValue[] xValues = null;
    if (attr1 != null) {
        int value = Integer.parseInt(attr1.toString());
        for (int i = 0; i < m_attributes.length; i++) {
            if (m_attributes[i].getKeyNamePair().getKey() == value) {
                xValues = m_attributes[i].getMAttributeValues();
                indexAttr1 = i;
                break;
            }
        }
    }
    if (xValues != null)
        noOfCols = xValues.length;
    //	y dimension
    int noOfRows = 2;
    int indexAttr2 = 0;
    MAttributeValue[] yValues = null;
    if (attr2 != null) {
        int value = Integer.parseInt(attr2.toString());
        for (int i = 0; i < m_attributes.length; i++) {
            if (m_attributes[i].getKeyNamePair().getKey() == value) {
                yValues = m_attributes[i].getMAttributeValues();
                indexAttr2 = i;
                break;
            }
        }
    }
    if (yValues != null)
        noOfRows = yValues.length;
    gridView.getChildren().clear();
    Rows rows = new Rows();
    gridView.appendChild(rows);
    log.info("Rows=" + noOfRows + " - Cols=" + noOfCols);
    for (int rowIndex = 0; rowIndex < noOfRows; rowIndex++) {
        Row row = new Row();
        row.setWidth("100%");
        rows.appendChild(row);
        for (int colIndex = 0; colIndex < noOfCols; colIndex++) {
            MAttributeValue xValue = null;
            if (xValues != null)
                xValue = xValues[colIndex];
            MAttributeValue yValue = null;
            if (yValues != null)
                yValue = yValues[rowIndex];
            if (rowIndex == 0 && colIndex == 0) {
                Vbox descr = new Vbox();
                descr.setWidth("100%");
                if (xValues != null) {
                    Div div = new Div();
                    div.setAlign("right");
                    div.appendChild(new Label(m_attributes[indexAttr1].getName()));
                    descr.appendChild(div);
                }
                if (yValues != null)
                    descr.appendChild(new Label(m_attributes[indexAttr2].getName()));
                row.appendChild(descr);
            } else if (//	column labels
            rowIndex == 0) {
                if (xValue != null) {
                    Div div = new Div();
                    div.setAlign("center");
                    div.appendChild(new Label(xValue.getName()));
                    row.appendChild(div);
                } else
                    row.appendChild(new Label());
            } else if (//	row labels
            colIndex == 0) {
                if (yValue != null)
                    row.appendChild(new Label(yValue.getName()));
                else
                    row.appendChild(new Label());
            } else {
                row.appendChild(getGridElement(xValue, yValue));
            }
        }
    }
    tabbox.setSelectedIndex(1);
    m_setting = false;
}
Also used : Div(org.zkoss.zul.Div) MAttributeValue(org.compiere.model.MAttributeValue) Label(org.adempiere.webui.component.Label) ListItem(org.adempiere.webui.component.ListItem) Row(org.adempiere.webui.component.Row) Vbox(org.zkoss.zul.Vbox) Rows(org.adempiere.webui.component.Rows)

Example 25 with Row

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

the class WAttributeGrid method initForm.

/**
	 * 	Init
	 *	@param WindowNo
	 *	@param frame
	 */
protected void initForm() {
    m_attributes = MAttribute.getOfClient(Env.getCtx(), true, true);
    KeyNamePair[] vector = new KeyNamePair[m_attributes.length + 1];
    vector[0] = new KeyNamePair(0, "");
    for (int i = 0; i < m_attributes.length; i++) vector[i + 1] = m_attributes[i].getKeyNamePair();
    attributeCombo1 = new Listbox(vector);
    attributeCombo1.setMold("select");
    attributeCombo1.setSelectedIndex(0);
    attributeCombo2 = new Listbox(vector);
    attributeCombo2.setMold("select");
    attributeCombo2.setSelectedIndex(0);
    pickPriceList.setMold("select");
    pickWarehouse.setMold("select");
    fillPicks();
    for (int i = 0; i < MODES.length; i++) modeCombo.appendItem(MODES[i], MODES[i]);
    modeCombo.setMold("select");
    tabbox.setWidth("100%");
    tabbox.setHeight("85%");
    tabbox.appendChild(tabs);
    tabbox.appendChild(tabpanels);
    tabbox.addEventListener(Events.ON_SELECT, this);
    Grid gridSelection = new Grid();
    gridSelection.setWidth("500px");
    gridSelection.setStyle("margin:0; padding:0;");
    gridSelection.makeNoStrip();
    gridSelection.setOddRowSclass("even");
    gridView.setWidth("100%");
    gridView.setHeight("100%");
    gridView.setFixedLayout(true);
    Rows rows = new Rows();
    gridSelection.appendChild(rows);
    Row row = new Row();
    rows.appendChild(row);
    row.setSpans("1, 2");
    Div div = new Div();
    div.setAlign("right");
    div.appendChild(attributeLabel1);
    row.appendChild(div);
    row.appendChild(attributeCombo1);
    attributeCombo1.setWidth("100%");
    row = new Row();
    rows.appendChild(row);
    row.setSpans("1, 2");
    div = new Div();
    div.setAlign("right");
    div.appendChild(attributeLabel2);
    row.appendChild(div);
    row.appendChild(attributeCombo2);
    attributeCombo2.setWidth("100%");
    row = new Row();
    rows.appendChild(row);
    row.setSpans("1, 2");
    div = new Div();
    div.setAlign("right");
    div.appendChild(labelPriceList);
    row.appendChild(div);
    row.appendChild(pickPriceList);
    pickPriceList.setWidth("100%");
    row = new Row();
    rows.appendChild(row);
    row.setSpans("1, 2");
    div = new Div();
    div.setAlign("right");
    div.appendChild(labelWarehouse);
    row.appendChild(div);
    row.appendChild(pickWarehouse);
    pickWarehouse.setWidth("100%");
    div = new Div();
    div.setAlign("center");
    div.appendChild(gridSelection);
    Tabpanel tabSelectionPanel = new Tabpanel();
    tabSelectionPanel.appendChild(div);
    Tab tabSelection = new Tab(Msg.getMsg(Env.getCtx(), "Selection"));
    tabpanels.appendChild(tabSelectionPanel);
    tabs.appendChild(tabSelection);
    div = new Div();
    div.setAlign("center");
    div.appendChild(modeLabel);
    div.appendChild(modeCombo);
    modeCombo.addEventListener(Events.ON_CHANGE, this);
    Vbox vbAttributeGrid = new Vbox();
    vbAttributeGrid.appendChild(div);
    vbAttributeGrid.appendChild(gridView);
    Tabpanel tabAttributeGridPanel = new Tabpanel();
    tabAttributeGridPanel.appendChild(vbAttributeGrid);
    Tab tabAttributeGrid = new Tab(Msg.getMsg(Env.getCtx(), "AttributeGrid"));
    tabpanels.appendChild(tabAttributeGridPanel);
    tabs.appendChild(tabAttributeGrid);
    this.setWidth("100%");
    this.setHeight("100%");
    this.appendChild(tabbox);
    tabbox.addEventListener(Events.ON_SELECT, this);
    this.appendChild(confirmPanel);
    confirmPanel.addActionListener(this);
}
Also used : Div(org.zkoss.zul.Div) Tab(org.adempiere.webui.component.Tab) Grid(org.adempiere.webui.component.Grid) KeyNamePair(org.compiere.util.KeyNamePair) Row(org.adempiere.webui.component.Row) Listbox(org.adempiere.webui.component.Listbox) Tabpanel(org.adempiere.webui.component.Tabpanel) Vbox(org.zkoss.zul.Vbox) 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