use of org.adempiere.webui.component.Checkbox 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();
}
use of org.adempiere.webui.component.Checkbox 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);
}
use of org.adempiere.webui.component.Checkbox 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);
}
use of org.adempiere.webui.component.Checkbox in project adempiere by adempiere.
the class WBOMDrop method onEvent.
// addDisplay
/**************************************************************************
* Action Listener
* @param e event
*/
public void onEvent(Event e) throws Exception {
log.config(e.getName());
Object source = e.getTarget();
// Toggle Qty Enabled
if (source instanceof Checkbox || source instanceof Radio) {
cmd_selection(source);
// need to de-select the others in group
if (source instanceof Radio) {
// find Button Group
Iterator<Radiogroup> it = m_buttonGroups.values().iterator();
while (it.hasNext()) {
Radiogroup group = it.next();
Enumeration en = (Enumeration) group.getChildren();
while (en.hasMoreElements()) {
// We found the group
if (source == en.nextElement()) {
Enumeration info = (Enumeration) group.getChildren();
while (info.hasMoreElements()) {
Object infoObj = info.nextElement();
if (source != infoObj)
cmd_selection(infoObj);
}
}
}
}
}
} else // Product / Qty
if (source == productField || source == productQty) {
m_qty = productQty.getValue();
ListItem listitem = productField.getSelectedItem();
KeyNamePair pp = null;
if (listitem != null)
pp = listitem.toKeyNamePair();
m_product = MProduct.get(Env.getCtx(), pp.getKey());
createMainPanel();
//sizeIt();
} else // Order
if (source == orderField) {
ListItem listitem = orderField.getSelectedItem();
KeyNamePair pp = null;
if (listitem != null)
pp = listitem.toKeyNamePair();
boolean valid = (pp != null && pp.getKey() > 0);
if (invoiceField != null)
invoiceField.setEnabled(!valid);
if (projectField != null)
projectField.setEnabled(!valid);
} else // Invoice
if (source == invoiceField) {
ListItem listitem = invoiceField.getSelectedItem();
KeyNamePair pp = null;
if (listitem != null)
pp = listitem.toKeyNamePair();
boolean valid = (pp != null && pp.getKey() > 0);
if (orderField != null)
orderField.setEnabled(!valid);
if (projectField != null)
projectField.setEnabled(!valid);
} else // Project
if (source == projectField) {
ListItem listitem = projectField.getSelectedItem();
KeyNamePair pp = null;
if (listitem != null)
pp = listitem.toKeyNamePair();
boolean valid = (pp != null && pp.getKey() > 0);
//
if (orderField != null)
orderField.setEnabled(!valid);
if (invoiceField != null)
invoiceField.setEnabled(!valid);
} else // OK
if (confirmPanel.getButton("Ok").equals(e.getTarget())) {
if (cmd_save())
SessionManager.getAppDesktop().closeActiveWindow();
} else if (confirmPanel.getButton("Cancel").equals(e.getTarget()))
SessionManager.getAppDesktop().closeActiveWindow();
// Enable OK
boolean OK = m_product != null;
if (OK) {
KeyNamePair pp = null;
if (orderField != null) {
ListItem listitem = orderField.getSelectedItem();
if (listitem != null)
pp = listitem.toKeyNamePair();
}
if ((pp == null || pp.getKey() <= 0) && invoiceField != null) {
ListItem listitem = invoiceField.getSelectedItem();
if (listitem != null)
pp = listitem.toKeyNamePair();
}
if ((pp == null || pp.getKey() <= 0) && projectField != null) {
ListItem listitem = projectField.getSelectedItem();
if (listitem != null)
pp = listitem.toKeyNamePair();
}
OK = (pp != null && pp.getKey() > 0);
}
confirmPanel.setEnabled("Ok", OK);
}
use of org.adempiere.webui.component.Checkbox in project adempiere by adempiere.
the class MenuPanel method initComponents.
private void initComponents() {
this.setWidth("100%");
this.setHeight("100%");
this.setStyle("position: relative");
menuTree = new Tree();
menuTree.setMultiple(false);
menuTree.setId("mnuMain");
menuTree.setWidth("100%");
menuTree.setVflex(true);
menuTree.setSizedByContent(false);
// Due to bug in the new paging functionality
menuTree.setPageSize(-1);
menuTree.setStyle("border: none");
pnlSearch = new TreeSearchPanel(menuTree);
Toolbar toolbar = new Toolbar();
toolbar.setMold("panel");
toolbar.appendChild(pnlSearch);
this.appendChild(toolbar);
Panelchildren pc = new Panelchildren();
this.appendChild(pc);
pc.appendChild(menuTree);
// Elaine 2009/02/27 - expand tree
toolbar = new Toolbar();
toolbar.setStyle("verticle-align: middle; padding: 2px");
chkExpand = new Checkbox();
chkExpand.setText(Msg.getMsg(Env.getCtx(), "ExpandTree"));
chkExpand.addEventListener(Events.ON_CHECK, this);
toolbar.appendChild(chkExpand);
toolbar.setMold("panel");
this.appendChild(toolbar);
}
Aggregations