Search in sources :

Example 1 with WPAttributeEditor

use of org.adempiere.webui.editor.WPAttributeEditor in project adempiere by adempiere.

the class InfoPanel method valueChange.

//  onEvent
/**
	 * Capture value changes in WSearchEditor components specifically.
	 * Copy and override as required.
	 * @param evt
	 */
public void valueChange(ValueChangeEvent evt) {
    Object c = null;
    if (evt.getSource() instanceof WSearchEditor)
        c = ((WSearchEditor) evt.getSource()).getComponent();
    else if (evt.getSource() instanceof WPAttributeEditor)
        c = ((WPAttributeEditor) evt.getSource()).getComponent();
    if (c == null)
        return;
    // Pass it off to the event handler to process.
    Event e = new Event("onChange", (Component) c);
    onEvent(e);
}
Also used : WSearchEditor(org.adempiere.webui.editor.WSearchEditor) ValueChangeEvent(org.adempiere.exceptions.ValueChangeEvent) Event(org.zkoss.zk.ui.event.Event) SelectEvent(org.zkoss.zk.ui.event.SelectEvent) WTableModelEvent(org.adempiere.webui.event.WTableModelEvent) WPAttributeEditor(org.adempiere.webui.editor.WPAttributeEditor)

Example 2 with WPAttributeEditor

use of org.adempiere.webui.editor.WPAttributeEditor 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 3 with WPAttributeEditor

use of org.adempiere.webui.editor.WPAttributeEditor in project adempiere by adempiere.

the class WPaySelect method valueChange.

/**
	 * Capture value changes in WSearchEditor components specifically.
	 * Copy and override as required.
	 * @param evt
	 */
public void valueChange(ValueChangeEvent evt) {
    Object c = null;
    if (evt.getSource() instanceof WSearchEditor)
        c = ((WSearchEditor) evt.getSource()).getComponent();
    else if (evt.getSource() instanceof WPAttributeEditor)
        c = ((WPAttributeEditor) evt.getSource()).getComponent();
    else if (evt.getSource() instanceof WDateEditor)
        c = ((WDateEditor) evt.getSource()).getComponent();
    if (c == null)
        return;
    // Pass it off to the event handler to process.
    Event e = new Event("onChange", (Component) c);
    onEvent(e);
}
Also used : WDateEditor(org.adempiere.webui.editor.WDateEditor) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) ValueChangeEvent(org.adempiere.exceptions.ValueChangeEvent) Event(org.zkoss.zk.ui.event.Event) WTableModelEvent(org.adempiere.webui.event.WTableModelEvent) WPAttributeEditor(org.adempiere.webui.editor.WPAttributeEditor)

Example 4 with WPAttributeEditor

use of org.adempiere.webui.editor.WPAttributeEditor in project adempiere by adempiere.

the class WOrderReceiptIssue method fillPicks.

//	init
/**
	 *	Fill Picks
	 *		Column_ID from C_Order
	 *	This is only run as part of the windows initialization process
	 *  @throws Exception if Lookups cannot be initialized
	 */
private void fillPicks() throws Exception {
    Properties ctx = Env.getCtx();
    // Base Language
    Language language = Language.getLoginLanguage();
    MLookup orderLookup = MLookupFactory.get(ctx, m_WindowNo, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_PP_Order_ID), DisplayType.Search, language, "PP_Order_ID", 0, false, "PP_Order.DocStatus = '" + MPPOrder.DOCACTION_Complete + "'");
    orderField = new WSearchEditor(MPPOrder.COLUMNNAME_PP_Order_ID, false, false, true, orderLookup);
    orderField.addValueChangeListener(this);
    MLookup resourceLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_S_Resource_ID), DisplayType.TableDir);
    resourceField = new WSearchEditor(MPPOrder.COLUMNNAME_S_Resource_ID, false, false, false, resourceLookup);
    MLookup warehouseLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir);
    warehouseField = new WSearchEditor(MPPOrder.COLUMNNAME_M_Warehouse_ID, false, false, false, warehouseLookup);
    MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Product_ID), DisplayType.TableDir);
    productField = new WSearchEditor(MPPOrder.COLUMNNAME_M_Product_ID, false, false, false, productLookup);
    MLookup uomLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
    uomField = new WSearchEditor(MPPOrder.COLUMNNAME_C_UOM_ID, false, false, false, uomLookup);
    MLookup uomOrderLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
    uomorderField = new WSearchEditor(MPPOrder.COLUMNNAME_C_UOM_ID, false, false, false, uomOrderLookup);
    MLocatorLookup locatorL = new MLocatorLookup(ctx, m_WindowNo);
    locatorField = new WLocatorEditor(MLocator.COLUMNNAME_M_Locator_ID, true, false, true, locatorL, m_WindowNo);
    //  Tab, Window
    int m_Window = MWindow.getWindow_ID("Manufacturing Order");
    GridFieldVO vo = GridFieldVO.createStdField(ctx, m_WindowNo, 0, m_Window, MTab.getTab_ID(m_Window, "Manufacturing Order"), false, false, false);
    vo.AD_Column_ID = MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID);
    vo.ColumnName = MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID;
    vo.displayType = DisplayType.PAttribute;
    GridField field = new GridField(vo);
    // M_AttributeSetInstance_ID
    attribute = new WPAttributeEditor(field.getGridTab(), field);
    attribute.setReadWrite(true);
    attribute.setValue(0);
    // 4Layers - Further init
    scrapQtyField.setValue(Env.ZERO);
    rejectQty.setValue(Env.ZERO);
    // 4Layers - end
    pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@IsBackflush@"), 1);
    pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@OnlyIssue@"), 2);
    pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@OnlyReceiptProduct@"), 3);
    pickcombo.addEventListener(Events.ON_CHANGE, this);
    Process.addActionListener(this);
    toDeliverQty.addValueChangeListener(this);
    scrapQtyField.addValueChangeListener(this);
}
Also used : MLocatorLookup(org.compiere.model.MLocatorLookup) WLocatorEditor(org.adempiere.webui.editor.WLocatorEditor) Language(org.compiere.util.Language) GridFieldVO(org.compiere.model.GridFieldVO) MLookup(org.compiere.model.MLookup) WSearchEditor(org.adempiere.webui.editor.WSearchEditor) GridField(org.compiere.model.GridField) Properties(java.util.Properties) WPAttributeEditor(org.adempiere.webui.editor.WPAttributeEditor)

Aggregations

WPAttributeEditor (org.adempiere.webui.editor.WPAttributeEditor)4 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)3 ValueChangeEvent (org.adempiere.exceptions.ValueChangeEvent)2 WTableModelEvent (org.adempiere.webui.event.WTableModelEvent)2 Event (org.zkoss.zk.ui.event.Event)2 Properties (java.util.Properties)1 Checkbox (org.adempiere.webui.component.Checkbox)1 Label (org.adempiere.webui.component.Label)1 Textbox (org.adempiere.webui.component.Textbox)1 WDateEditor (org.adempiere.webui.editor.WDateEditor)1 WLocatorEditor (org.adempiere.webui.editor.WLocatorEditor)1 WTableDirEditor (org.adempiere.webui.editor.WTableDirEditor)1 GridField (org.compiere.model.GridField)1 GridFieldVO (org.compiere.model.GridFieldVO)1 MLocatorLookup (org.compiere.model.MLocatorLookup)1 MLookup (org.compiere.model.MLookup)1 MPAttributeLookup (org.compiere.model.MPAttributeLookup)1 Language (org.compiere.util.Language)1 SelectEvent (org.zkoss.zk.ui.event.SelectEvent)1