Search in sources :

Example 6 with Textbox

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

the class InfoPaymentPanel method statInit.

// InfoPaymentPanel
/**
	 *	Static Setup - add fields to parameterPanel
	 */
private void statInit() {
    fDocumentNo = new Textbox();
    fDocumentNo.setWidth("100%");
    fDocumentNo.addEventListener(Events.ON_CHANGE, this);
    fDocumentNo.setAttribute("zk_component_ID", "Lookup_Criteria_fDocumentNo");
    fDocumentNo.addEventListener(Events.ON_CHANGE, this);
    // 	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());
    //
    fCheckReceipt.setLabel(Msg.translate(Env.getCtx(), "OnlyReceipt"));
    fCheckReceipt.setName("OnlyReceipt");
    fCheckReceipt.addEventListener(Events.ON_CHECK, this);
    fCheckReceipt.setAttribute("zk_component_ID", "Lookup_Criteria_CheckReceipt");
    //
    fCheckPayment.setLabel(Msg.translate(Env.getCtx(), "OnlyPayment"));
    fCheckPayment.setName("OnlyPayment");
    fCheckPayment.addEventListener(Events.ON_CHECK, this);
    fCheckPayment.setAttribute("zk_component_ID", "Lookup_Criteria_CheckPayment");
    //
    fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.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);
    fBankAccount_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_BankAccount_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BankAccount_ID"), "", false, false, true);
    fBankAccount_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
    fBankAccount_ID.addValueChangeListener(this);
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(lDocumentNo.rightAlign());
    row.appendChild(fDocumentNo);
    row.appendChild(fBPartner_ID.getLabel().rightAlign());
    row.appendChild(fBPartner_ID.getComponent());
    row.appendChild(fCheckReceipt);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(fBankAccount_ID.getLabel().rightAlign());
    row.appendChild(fBankAccount_ID.getComponent());
    row.appendChild(lDateFrom.rightAlign());
    Hbox hbox = new Hbox();
    hbox.appendChild(fDateFrom);
    hbox.appendChild(lDateTo);
    hbox.appendChild(fDateTo);
    row.appendChild(hbox);
    row.appendChild(fCheckPayment);
    row = new Row();
    rows.appendChild(row);
    row.appendCellChild(lAmtFrom.rightAlign(), 3);
    hbox = new Hbox();
    hbox.appendChild(fAmtFrom);
    hbox.appendChild(lAmtTo);
    hbox.appendChild(fAmtTo);
    row.appendCellChild(hbox, 1);
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
}
Also used : Hbox(org.zkoss.zul.Hbox) Datebox(org.adempiere.webui.component.Datebox) DecimalFormat(java.text.DecimalFormat) Textbox(org.adempiere.webui.component.Textbox) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) NumberBox(org.adempiere.webui.component.NumberBox) Row(org.adempiere.webui.component.Row) SimpleDateFormat(java.text.SimpleDateFormat) Rows(org.adempiere.webui.component.Rows)

Example 7 with Textbox

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

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

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

Example 10 with Textbox

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

the class WPAttributeDialog method saveSelection.

//	cmd_zoom
/**
	 *	Save Selection
	 *	@return true if saved
	 */
private boolean saveSelection() {
    log.info("");
    MAttributeSet as = m_masi.getMAttributeSet();
    if (as == null)
        return true;
    //
    m_changed = false;
    String mandatory = "";
    if (!m_productWindow && as.isLot()) {
        log.fine("Lot=" + fieldLotString.getText());
        String text = fieldLotString.getText();
        m_masi.setLot(text);
        if (as.isLotMandatory() && (text == null || text.length() == 0))
            mandatory += " - " + Msg.translate(Env.getCtx(), "Lot");
        m_changed = true;
    }
    //	Lot
    if (!m_productWindow && as.isSerNo()) {
        log.fine("SerNo=" + fieldSerNo.getText());
        String text = fieldSerNo.getText();
        m_masi.setSerNo(text);
        if (as.isSerNoMandatory() && (text == null || text.length() == 0))
            mandatory += " - " + Msg.translate(Env.getCtx(), "SerNo");
        m_changed = true;
    }
    //	SerNo
    if (!m_productWindow && as.isGuaranteeDate()) {
        log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue());
        Date gDate = fieldGuaranteeDate.getValue();
        Timestamp ts = gDate != null ? new Timestamp(gDate.getTime()) : null;
        m_masi.setGuaranteeDate(ts);
        if (as.isGuaranteeDateMandatory() && ts == null)
            mandatory += " - " + Msg.translate(Env.getCtx(), "GuaranteeDate");
        m_changed = true;
    }
    //	New Instance
    if (m_changed || m_masi.getM_AttributeSetInstance_ID() == 0) {
        m_masi.save();
        m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID();
        m_M_AttributeSetInstanceName = m_masi.getDescription();
    }
    //  Save attributes
    if (m_M_AttributeSetInstance_ID > 0) {
        //	Save Instance Attributes
        MAttribute[] attributes = as.getMAttributes(!m_productASI);
        for (int i = 0; i < attributes.length; i++) {
            if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributes[i].getAttributeValueType())) {
                Listbox editor = (Listbox) m_editors.get(i);
                ListItem item = editor.getSelectedItem();
                MAttributeValue value = item != null ? (MAttributeValue) item.getValue() : null;
                log.fine(attributes[i].getName() + "=" + value);
                if (attributes[i].isMandatory() && value == null)
                    mandatory += " - " + attributes[i].getName();
                attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value);
            } else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributes[i].getAttributeValueType())) {
                NumberBox editor = (NumberBox) m_editors.get(i);
                BigDecimal value = editor.getValue();
                log.fine(attributes[i].getName() + "=" + value);
                if (attributes[i].isMandatory() && value == null)
                    mandatory += " - " + attributes[i].getName();
                //setMAttributeInstance doesn't work without decimal point
                if (value != null && value.scale() == 0)
                    value = value.setScale(1, BigDecimal.ROUND_HALF_UP);
                attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value);
            } else {
                Textbox editor = (Textbox) m_editors.get(i);
                String value = editor.getText();
                log.fine(attributes[i].getName() + "=" + value);
                if (attributes[i].isMandatory() && (value == null || value.length() == 0))
                    mandatory += " - " + attributes[i].getName();
                attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value);
            }
        }
        m_changed = true;
    }
    //	Save Model
    if (m_changed) {
        m_masi.setDescription();
        m_masi.save();
    }
    m_M_AttributeSetInstance_ID = m_masi.getM_AttributeSetInstance_ID();
    m_M_AttributeSetInstanceName = m_masi.getDescription();
    //
    if (mandatory.length() > 0) {
        FDialog.error(m_WindowNo, this, "FillMandatory", mandatory);
        return false;
    }
    return true;
}
Also used : Textbox(org.adempiere.webui.component.Textbox) NumberBox(org.adempiere.webui.component.NumberBox) Timestamp(java.sql.Timestamp) Date(java.util.Date) BigDecimal(java.math.BigDecimal) MAttributeSet(org.compiere.model.MAttributeSet) MAttributeValue(org.compiere.model.MAttributeValue) ListItem(org.adempiere.webui.component.ListItem) Listbox(org.adempiere.webui.component.Listbox) MAttribute(org.compiere.model.MAttribute)

Aggregations

Textbox (org.adempiere.webui.component.Textbox)21 Label (org.adempiere.webui.component.Label)11 Checkbox (org.adempiere.webui.component.Checkbox)8 NumberBox (org.adempiere.webui.component.NumberBox)6 Datebox (org.adempiere.webui.component.Datebox)5 DecimalFormat (java.text.DecimalFormat)4 SimpleDateFormat (java.text.SimpleDateFormat)4 Button (org.adempiere.webui.component.Button)4 Component (org.zkoss.zk.ui.Component)4 Hbox (org.zkoss.zul.Hbox)4 Combobox (org.adempiere.webui.component.Combobox)3 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)3 ListItem (org.adempiere.webui.component.ListItem)3 Listbox (org.adempiere.webui.component.Listbox)3 Row (org.adempiere.webui.component.Row)3 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)3 BigDecimal (java.math.BigDecimal)2 WPOSKeyboard (org.adempiere.pos.WPOSKeyboard)2 Rows (org.adempiere.webui.component.Rows)2 IDColumn (org.compiere.minigrid.IDColumn)2