Search in sources :

Example 21 with Label

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

the class InfoPAttributePanel method addAttributes.

//	dynInit
/**
	 * 	Add Attributes
	 *	@return rows
	 */
private int addAttributes() {
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String whereAttributeSet;
    if (p_M_AttributeSet_ID > 0)
        whereAttributeSet = "AND M_Attribute_ID IN (SELECT M_Attribute_ID FROM M_AttributeUse WHERE M_AttributeSet_ID=" + p_M_AttributeSet_ID + ")";
    else
        whereAttributeSet = "";
    String sql = MRole.getDefault().addAccessSQL("SELECT M_Attribute_ID, Name, Description, AttributeValueType, IsInstanceAttribute " + "FROM M_Attribute " + "WHERE IsActive='Y' " + whereAttributeSet + " ORDER BY IsInstanceAttribute, Name", "M_Attribute", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
    boolean instanceLine = false;
    boolean productLine = false;
    try {
        pstmt = DB.prepareStatement(sql, null);
        rs = pstmt.executeQuery();
        while (rs.next()) {
            int attribute_ID = rs.getInt(1);
            String name = rs.getString(2);
            String description = rs.getString(3);
            String attributeValueType = rs.getString(4);
            boolean isInstanceAttribute = "Y".equals(rs.getString(5));
            // Add label for product attributes if there are any
            if (!productLine && !isInstanceAttribute) {
                Row row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Label group = new Label(Msg.translate(Env.getCtx(), "IsProductAttribute"));
                row.appendChild(group);
                rows.appendChild(row);
                row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Separator separator = new Separator();
                separator.setBar(true);
                row.appendChild(separator);
                rows.appendChild(row);
                productLine = true;
            }
            //	Add label for Instances attributes
            if (!instanceLine && isInstanceAttribute) {
                Row row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Label group = new Label(Msg.translate(Env.getCtx(), "IsInstanceAttribute"));
                row.appendChild(group);
                rows.appendChild(row);
                row = new Row();
                rows.appendChild(row);
                row.setSpans("2");
                Separator separator = new Separator();
                separator.setBar(true);
                row.appendChild(separator);
                rows.appendChild(row);
                instanceLine = true;
            }
            //
            Row row = new Row();
            rows.appendChild(row);
            Label label = new Label(name);
            if (description != null && description.length() > 0)
                label.setTooltiptext(description);
            Div div = new Div();
            div.setAlign("right");
            div.appendChild(label);
            row.appendChild(div);
            Component field = null;
            if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributeValueType)) {
                field = new Listbox();
                ((Listbox) field).setRows(0);
                ((Listbox) field).setMultiple(false);
                ((Listbox) field).setMold("select");
                ((Listbox) field).setWidth("150px");
                KeyNamePair[] knp = getAttributeList(attribute_ID);
                for (int i = 0; i < knp.length; i++) ((Listbox) field).appendItem(knp[i].getName(), knp[i]);
            } else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) {
                field = new WNumberEditor(name, false, false, true, DisplayType.Number, name).getComponent();
                ((NumberBox) field).setWidth("150px");
            } else {
                field = new WStringEditor(name, false, false, true, 10, 40, null, null).getComponent();
                ((Textbox) field).setWidth("150px");
            }
            row.appendChild(field);
            //
            field.setId(String.valueOf(attribute_ID));
            // If name is null, replace it with "_"
            if (name.equals("")) {
                name = "_";
            }
            field.setAttribute("zk_component_ID", "InfoPAttributePanel_field_" + name.replaceAll("[^a-zA-Z0-9_]", "_"));
            //
            if (isInstanceAttribute)
                m_instanceEditors.add(field);
            else
                m_productEditors.add(field);
            //	To (numbers)
            Component fieldTo = null;
            if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) {
                fieldTo = new WNumberEditor(name, false, false, true, DisplayType.Number, name).getComponent();
                ((NumberBox) fieldTo).setWidth("150px");
                row = new Row();
                rows.appendChild(row);
                div = new Div();
                div.setAlign("right");
                div.appendChild(new Label("-"));
                row.appendChild(div);
                row.appendChild(fieldTo);
            }
            if (fieldTo != null)
                fieldTo.setAttribute("zk_component_ID", "InfoPAttributePanel_fieldTo_" + name);
            if (isInstanceAttribute)
                m_instanceEditorsTo.add(fieldTo);
            else
                m_productEditorsTo.add(fieldTo);
        }
    } catch (Exception e) {
        log.log(Level.SEVERE, sql, e);
    } finally {
        DB.close(rs, pstmt);
        rs = null;
        pstmt = null;
    }
    // print instance line if not printed
    if (!instanceLine) {
        boolean isGuarantee = true;
        boolean isSerial = true;
        boolean isLot = true;
        if (p_M_AttributeSet_ID > 0) {
            MAttributeSet as = new MAttributeSet(Env.getCtx(), p_M_AttributeSet_ID, null);
            isGuarantee = as.isGuaranteeDate();
            isSerial = as.isSerNo();
            isLot = as.isLot();
        }
        if (isGuarantee || isSerial || isLot) {
            Row row = new Row();
            rows.appendChild(row);
            row.setSpans("2");
            Label group = new Label(Msg.translate(Env.getCtx(), "IsInstanceAttribute"));
            row.appendChild(group);
            rows.appendChild(row);
            row = new Row();
            rows.appendChild(row);
            row.setSpans("2");
            Separator separator = new Separator();
            separator.setBar(true);
            row.appendChild(separator);
            rows.appendChild(row);
            instanceLine = true;
        }
    }
    return 0;
}
Also used : Label(org.adempiere.webui.component.Label) PreparedStatement(java.sql.PreparedStatement) NumberBox(org.adempiere.webui.component.NumberBox) WStringEditor(org.adempiere.webui.editor.WStringEditor) MAttributeSet(org.compiere.model.MAttributeSet) Div(org.zkoss.zul.Div) ResultSet(java.sql.ResultSet) Row(org.adempiere.webui.component.Row) KeyNamePair(org.compiere.util.KeyNamePair) Component(org.zkoss.zk.ui.Component) Listbox(org.adempiere.webui.component.Listbox) Separator(org.zkoss.zul.Separator) WNumberEditor(org.adempiere.webui.editor.WNumberEditor)

Example 22 with Label

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

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

the class InfoProductPanel method initComponents.

//	InfoProductPanel
/**
	 *	initialize fields
	 */
private void initComponents() {
    lblBlank.setValue(" ");
    lblValue = new Label();
    lblValue.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Value")));
    lblName = new Label();
    lblName.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Name")));
    lblUPC = new Label();
    lblUPC.setValue(Msg.translate(Env.getCtx(), "UPC"));
    lblSKU = new Label();
    lblSKU.setValue(Msg.translate(Env.getCtx(), "SKU"));
    lblPriceList = new Label();
    lblPriceList.setValue(Msg.getMsg(Env.getCtx(), "PriceListVersion"));
    // Elaine 2008/11/21
    lblProductCategory = new Label();
    lblProductCategory.setValue(Msg.translate(Env.getCtx(), "M_Product_Category_ID"));
    //
    lblAS = new Label();
    lblAS.setValue(Msg.translate(Env.getCtx(), "M_AttributeSet_ID"));
    lblASI = new Label();
    lblASI.setValue(Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID"));
    lblWarehouse = new Label();
    lblWarehouse.setValue(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Warehouse")));
    lblVendor = new Label();
    lblVendor.setValue(Msg.translate(Env.getCtx(), "Vendor"));
    checkOnlyStock = new Checkbox();
    checkOnlyStock.setAttribute("zk_component_ID", "Lookup_Criteria_checkOnlyStock");
    checkOnlyStock.setText(Msg.getMsg(Env.getCtx(), "OnlyStock"));
    checkOnlyStock.setName("OnlyStock");
    checkOnlyStock.setTooltiptext(Msg.getMsg(Env.getCtx(), "OnlyStockTip"));
    // Info may open when searching for non-stock as well.
    checkOnlyStock.setSelected(false);
    checkOnlyStock.addActionListener(this);
    checkShowDetail = new Checkbox();
    checkShowDetail.setAttribute("zk_component_ID", "Lookup_Criteria_checkShowDetail");
    checkShowDetail.setText(Msg.getMsg(Env.getCtx(), "ShowDetail"));
    checkShowDetail.setName("ShowDetail");
    checkShowDetail.setTooltiptext(Msg.getMsg(Env.getCtx(), "ShowAttributeDetails"));
    checkShowDetail.setSelected(false);
    checkShowDetail.setEnabled(false);
    checkShowDetail.addActionListener(this);
    checkAND = new Checkbox();
    checkAND.setAttribute("zk_component_ID", "Lookup_Criteria_checkAND");
    checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));
    checkAND.setName("SearchAND");
    checkAND.setTooltiptext(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));
    checkAND.setSelected(true);
    checkAND.addActionListener(this);
    m_InfoPAttributeButton.setImage(ServletFns.resolveThemeURL("~./images/PAttribute16.png"));
    m_InfoPAttributeButton.setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute"));
    m_InfoPAttributeButton.addEventListener(Events.ON_CLICK, this);
    fieldValue = new Textbox();
    //fieldValue.setMaxlength(40);
    fieldValue.setAttribute("zk_component_ID", "Lookup_Criteria_fieldValue");
    fieldValue.addEventListener(Events.ON_CHANGE, this);
    //
    fieldName = new Textbox();
    //fieldName.setMaxlength(40);
    fieldName.setAttribute("zk_component_ID", "Lookup_Criteria_fieldName");
    fieldName.addEventListener(Events.ON_CHANGE, this);
    //
    fieldUPC = new Textbox();
    //fieldUPC.setMaxlength(40);
    fieldUPC.setAttribute("zk_component_ID", "Lookup_Criteria_fieldUPC");
    fieldUPC.addEventListener(Events.ON_CHANGE, this);
    //
    fieldSKU = new Textbox();
    //fieldSKU.setMaxlength(40);
    fieldSKU.setAttribute("zk_component_ID", "Lookup_Criteria_fieldSKU");
    fieldSKU.addEventListener(Events.ON_CHANGE, this);
    //
    // Elaine 2008/11/25
    fieldDescription.setMultiline(true);
    fieldDescription.setReadonly(true);
    fieldDescription.setAttribute("zk_component_ID", "Lookup_Field_Description");
    //
    fPriceList_ID = new WTableDirEditor("M_PriceList_Version_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPriceListVersion.Table_Name, MPriceListVersion.COLUMNNAME_M_PriceList_Version_ID), DisplayType.TableDir));
    fPriceList_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    fPriceList_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_PriceList_Version_ID");
    fPriceList_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fPriceList_ID.getComponent().setAttribute("IsDynamic", "True");
    fPriceList_ID.getComponent().setAttribute("fieldName", "fPriceList_ID");
    // Elaine 2008/11/21
    fProductCategory_ID = new WTableDirEditor("M_Product_Category_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MProductCategory.Table_Name, MProductCategory.COLUMNNAME_M_Product_Category_ID), DisplayType.TableDir));
    fProductCategory_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    fProductCategory_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_ProductCategory_ID");
    fProductCategory_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fProductCategory_ID.getComponent().setAttribute("IsDynamic", "True");
    fProductCategory_ID.getComponent().setAttribute("fieldName", "fProductCategory_ID");
    //
    fAS_ID = new WTableDirEditor("M_AttributeSet_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MAttributeSet.Table_Name, MAttributeSet.COLUMNNAME_M_AttributeSet_ID), DisplayType.TableDir));
    fAS_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    fAS_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_PAttributeSet_ID");
    fAS_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fAS_ID.getComponent().setAttribute("IsDynamic", "False");
    fAS_ID.getComponent().setAttribute("fieldName", "fAS_ID");
    fAS_ID.getComponent().setWidth("200px");
    MPAttributeLookup mpaLookup = new MPAttributeLookup(Env.getCtx(), p_WindowNo);
    fASI_ID = new WPAttributeEditor(null, false, false, true, p_WindowNo, mpaLookup, true);
    fASI_ID.addValueChangeListener(this);
    fASI_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_PAttributeSetInstance_ID");
    fASI_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fASI_ID.getComponent().setAttribute("IsDynamic", "False");
    fASI_ID.getComponent().setAttribute("fieldName", "fASI_ID");
    fASI_ID.getComponent().setWidth("200px");
    fWarehouse_ID = new WTableDirEditor("M_Warehouse_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MWarehouse.Table_Name, MWarehouse.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir));
    fWarehouse_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
    fWarehouse_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_M_Warehouse_ID");
    fWarehouse_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fWarehouse_ID.getComponent().setAttribute("IsDynamic", "True");
    fWarehouse_ID.getComponent().setAttribute("fieldName", "fWarehouse_ID");
    //fVendor_ID.getComponent().getTextbox().setMaxlength(30);
    // Override the isSOTrx context, Vendors only
    fVendor_ID.setIsSOTrx(true, false);
    fVendor_ID.addValueChangeListener(this);
    fVendor_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
    fVendor_ID.getComponent().setAttribute("zk_component_prefix", "Lookup_");
    fVendor_ID.getComponent().setAttribute("IsDynamic", "False");
    fVendor_ID.getComponent().setAttribute("fieldName", "fVendor_ID");
    fVendor_ID.getComponent().setWidth("200px");
    // Product Attribute Instance
    m_PAttributeButton = confirmPanel.createButton(ConfirmPanel.A_PATTRIBUTE);
    confirmPanel.addComponentsLeft(m_PAttributeButton);
    m_PAttributeButton.addActionListener(this);
    m_PAttributeButton.setEnabled(false);
    //
    fieldPAttributes.setMultiline(true);
    fieldPAttributes.setReadonly(true);
    fieldPAttributes.setAttribute("zk_component_ID", "Lookup_Field_PAAttributes");
    initAtpTab();
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) Checkbox(org.adempiere.webui.component.Checkbox) Label(org.adempiere.webui.component.Label) Textbox(org.adempiere.webui.component.Textbox) MPAttributeLookup(org.compiere.model.MPAttributeLookup) WPAttributeEditor(org.adempiere.webui.editor.WPAttributeEditor)

Example 24 with Label

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

the class InfoInvoicePanel method initComponents.

private void initComponents() {
    lblDocumentNo = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "DocumentNo")));
    lblDescription = new Label(Msg.translate(Env.getCtx(), "Description"));
    lblDateInvoiced = new Label(Msg.translate(Env.getCtx(), "DateInvoiced"));
    lblGrandTotal = new Label(Msg.translate(Env.getCtx(), "GrandTotal"));
    //
    fDocumentNo = new Textbox();
    fDocumentNo.addEventListener(Events.ON_CHANGE, this);
    fDocumentNo.setAttribute("zk_component_ID", "Lookup_Criteria_DocumentNo");
    fDescription = new Textbox();
    fDescription.addEventListener(Events.ON_CHANGE, this);
    fDescription.setAttribute("zk_component_ID", "Lookup_Criteria_Description");
    // 	Format the dates and number boxes
    fDateFrom = new Datebox();
    fDateTo = new Datebox();
    fDateFrom.setWidth("97px");
    fDateTo.setWidth("97px");
    //
    fDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_DateFrom");
    fDateFrom.addEventListener(Events.ON_CHANGE, this);
    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());
    //
    DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount, AEnv.getLanguage(Env.getCtx()));
    fAmtFrom = new NumberBox(false);
    fAmtFrom.getDecimalbox().setWidth("90px");
    fAmtFrom.getDecimalbox().setFormat(format.toPattern());
    fAmtFrom.getDecimalbox().setStyle("text-align:right; " + fAmtFrom.getDecimalbox().getStyle());
    fAmtFrom.setAttribute("zk_component_ID", "Lookup_Criteria_AmtFrom");
    fAmtFrom.addEventListener(Events.ON_CHANGE, this);
    fAmtTo = new NumberBox(false);
    fAmtTo.getDecimalbox().setWidth("90px");
    fAmtTo.getDecimalbox().setFormat(format.toPattern());
    fAmtTo.getDecimalbox().setStyle("text-align:right; " + fAmtTo.getDecimalbox().getStyle());
    fAmtTo.setAttribute("zk_component_ID", "Lookup_Criteria_AmtTo");
    fAmtTo.addEventListener(Events.ON_CHANGE, this);
    //
    fIsPaid = new Checkbox();
    fIsPaid.setLabel(Msg.translate(Env.getCtx(), "IsPaid"));
    fIsPaid.setAttribute("zk_component_ID", "Lookup_Criteria_IsPaid");
    fIsPaid.addActionListener(this);
    //
    fIsSOTrx = new Checkbox();
    fIsSOTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
    fIsSOTrx.setAttribute("zk_component_ID", "Lookup_Criteria_IsSoTrx");
    fIsSOTrx.addActionListener(this);
    //
    fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInvoice.Table_Name, MInvoice.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);
    //
    fOrder_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInvoice.Table_Name, MInvoice.COLUMNNAME_C_Order_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_Order_ID"), "", false, false, true);
    fOrder_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Order_ID");
    fOrder_ID.addValueChangeListener(this);
}
Also used : Datebox(org.adempiere.webui.component.Datebox) Checkbox(org.adempiere.webui.component.Checkbox) DecimalFormat(java.text.DecimalFormat) Label(org.adempiere.webui.component.Label) Textbox(org.adempiere.webui.component.Textbox) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) NumberBox(org.adempiere.webui.component.NumberBox) SimpleDateFormat(java.text.SimpleDateFormat)

Example 25 with Label

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

the class InfoOrderPanel method initComponents.

public void initComponents() {
    lblDocumentNo = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "DocumentNo")));
    lblDescription = new Label(Msg.translate(Env.getCtx(), "Description"));
    lblDateOrdered = new Label(Msg.translate(Env.getCtx(), "DateOrdered"));
    lblOrderRef = new Label(Msg.translate(Env.getCtx(), "POReference"));
    lblGrandTotal = new Label(Msg.translate(Env.getCtx(), "GrandTotal"));
    fDocumentNo = new Textbox();
    fDocumentNo.addEventListener(Events.ON_CHANGE, this);
    fDocumentNo.setAttribute("zk_component_ID", "Lookup_Criteria_DocumentNo");
    fDescription = new Textbox();
    fDescription.addEventListener(Events.ON_CHANGE, this);
    fDescription.setAttribute("zk_component_ID", "Lookup_Criteria_Description");
    fPOReference = new Textbox();
    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());
    //
    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());
    //
    fIsSOTrx = new Checkbox();
    fIsSOTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
    fIsSOTrx.setName("IsSOTrx");
    fIsSOTrx.setAttribute("zk_component_ID", "Lookup_Criteria_IsSoTrx");
    fIsSOTrx.setAttribute("IsDynamic", "True");
    fIsSOTrx.addActionListener(this);
    fIsDelivered = new Checkbox();
    fIsDelivered.setLabel(Msg.translate(Env.getCtx(), "IsDelivered"));
    fIsDelivered.setName("IsDelivered");
    fIsDelivered.setAttribute("zk_component_ID", "Lookup_Criteria_IsDelivered");
    fIsDelivered.addActionListener(this);
    fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MOrder.Table_Name, MOrder.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);
}
Also used : Datebox(org.adempiere.webui.component.Datebox) Checkbox(org.adempiere.webui.component.Checkbox) DecimalFormat(java.text.DecimalFormat) Label(org.adempiere.webui.component.Label) Textbox(org.adempiere.webui.component.Textbox) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) NumberBox(org.adempiere.webui.component.NumberBox) SimpleDateFormat(java.text.SimpleDateFormat)

Aggregations

Label (org.adempiere.webui.component.Label)69 Row (org.adempiere.webui.component.Row)29 Rows (org.adempiere.webui.component.Rows)28 Div (org.zkoss.zul.Div)18 Hbox (org.zkoss.zul.Hbox)17 Panel (org.adempiere.webui.component.Panel)15 Grid (org.adempiere.webui.component.Grid)13 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)11 Textbox (org.adempiere.webui.component.Textbox)11 Center (org.zkoss.zkex.zul.Center)10 Separator (org.zkoss.zul.Separator)10 North (org.zkoss.zkex.zul.North)7 Checkbox (org.adempiere.webui.component.Checkbox)6 Caption (org.zkoss.zul.Caption)6 South (org.zkoss.zul.South)6 Listbox (org.adempiere.webui.component.Listbox)5 WTableDirEditor (org.adempiere.webui.editor.WTableDirEditor)5 South (org.zkoss.zkex.zul.South)5 Vbox (org.zkoss.zul.Vbox)5 SimpleDateFormat (java.text.SimpleDateFormat)4