Search in sources :

Example 1 with GridTab

use of org.compiere.model.GridTab in project adempiere by adempiere.

the class POWrapper method getPO.

/**
	 * 
	 * @param model
	 * @param checkOtherWrapper
	 *            if the given <code>model</code> is handled by a {@link GridTabWrapper} and this param is
	 *            <code>true</code>, then this method <b>loads a new PO from DB</b>, only using the given
	 *            <code>model</code>'s table name and record ID. If this param is <code>false</code> and
	 *            <code>model</code> is not handled by <code>POWrapper</code>, then this method returns
	 *            <code>null</code>.
	 * @return
	 */
@SuppressWarnings("unchecked")
public static <T extends PO> T getPO(Object model, boolean checkOtherWrapper) {
    if (model == null)
        return null;
    if (model instanceof PO)
        return (T) model;
    if (Proxy.isProxyClass(model.getClass())) {
        InvocationHandler ih = Proxy.getInvocationHandler(model);
        if (ih instanceof POWrapper) {
            POWrapper wrapper = (POWrapper) ih;
            return (T) wrapper.getPO();
        }
        if (ih instanceof GridTabWrapper && checkOtherWrapper) {
            // using the grid tab wrapper to load the PO
            final GridTab gridTab = GridTabWrapper.getGridTab(model);
            final String tableName = gridTab.get_TableName();
            final int recordID = gridTab.getKeyID(gridTab.getCurrentRow());
            return (T) MTable.get(Env.getCtx(), tableName).getPO(recordID, null);
        }
    }
    return null;
}
Also used : GridTab(org.compiere.model.GridTab) InvocationHandler(java.lang.reflect.InvocationHandler) PO(org.compiere.model.PO)

Example 2 with GridTab

use of org.compiere.model.GridTab in project adempiere by adempiere.

the class GridTabWrapper method isNull.

/**
	 * Check if given columnName's value is null
	 * 
	 * @param model
	 * @param columnName
	 * @return true if columnName's value is null
	 */
public static boolean isNull(Object model, String columnName) {
    final GridTab gridTab = getGridTab(model);
    if (gridTab == null) {
        return true;
    }
    final Object value = gridTab.getValue(columnName);
    return value == null;
}
Also used : GridTab(org.compiere.model.GridTab)

Example 3 with GridTab

use of org.compiere.model.GridTab in project adempiere by adempiere.

the class InterfaceWrapperHelper method getValue.

private static <T> T getValue(final Object model, final String columnName, final boolean throwExIfColumnNotFound) {
    Check.assumeNotNull(model, "model is not null");
    Check.assumeNotNull(columnName, "columnName is not null");
    if (GridTabWrapper.isHandled(model)) {
        final GridTab gridTab = GridTabWrapper.getGridTab(model);
        final GridField gridField = gridTab.getField(columnName);
        if (gridField == null) {
            if (throwExIfColumnNotFound) {
                throw new AdempiereException("No field with ColumnName=" + columnName + " found in " + gridTab + " for " + model);
            } else {
                return null;
            }
        }
        @SuppressWarnings("unchecked") final T value = (T) gridField.getValue();
        return value;
    } else if (POWrapper.isHandled(model)) {
        PO po = POWrapper.getPO(model, false);
        final int idx = po.get_ColumnIndex(columnName);
        if (idx < 0) {
            if (throwExIfColumnNotFound) {
                throw new AdempiereException("No columnName " + columnName + " found for " + model);
            } else {
                return null;
            }
        }
        @SuppressWarnings("unchecked") T value = (T) po.get_Value(idx);
        return value;
    } else {
        throw new AdempiereException("Model wrapping is not supported for " + model + " (class:" + model.getClass() + ")");
    }
}
Also used : GridTab(org.compiere.model.GridTab) AdempiereException(org.adempiere.exceptions.AdempiereException) GridField(org.compiere.model.GridField) PO(org.compiere.model.PO)

Example 4 with GridTab

use of org.compiere.model.GridTab in project adempiere by adempiere.

the class InfoProduct method statInit.

/**
	 *	Static Setup - add fields to parameterPanel
	 */
private void statInit() {
    labelValue.setText(Msg.getMsg(Env.getCtx(), "Value"));
    fieldValue.setBackground(AdempierePLAF.getInfoBackground());
    fieldValue.addActionListener(this);
    labelName.setText(Msg.getMsg(Env.getCtx(), "Name"));
    fieldName.setBackground(AdempierePLAF.getInfoBackground());
    fieldName.addActionListener(this);
    labelUPC.setText(Msg.translate(Env.getCtx(), "UPC"));
    fieldUPC.setBackground(AdempierePLAF.getInfoBackground());
    fieldUPC.addActionListener(this);
    labelSKU.setText(Msg.translate(Env.getCtx(), "SKU"));
    fieldSKU.setBackground(AdempierePLAF.getInfoBackground());
    fieldSKU.addActionListener(this);
    labelWarehouse.setText(Msg.getMsg(Env.getCtx(), "Warehouse"));
    fWarehouse_ID = new VLookup("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.setBackground(AdempierePLAF.getInfoBackground());
    fWarehouse_ID.addActionListener(this);
    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.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.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));
    checkAND.setName("SearchAND");
    checkAND.setToolTipText(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));
    checkAND.setSelected(true);
    checkAND.addActionListener(this);
    labelPriceList.setText(Msg.getMsg(Env.getCtx(), "PriceListVersion"));
    fPriceList_ID = new VLookup("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.setBackground(AdempierePLAF.getInfoBackground());
    fPriceList_ID.addActionListener(this);
    labelProductCategory.setText(Msg.translate(Env.getCtx(), "M_Product_Category_ID"));
    fProductCategory_ID = new VLookup("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.setBackground(AdempierePLAF.getInfoBackground());
    fProductCategory_ID.addActionListener(this);
    // @Trifon
    labelAS.setText(Msg.translate(Env.getCtx(), "M_AttributeSet_ID"));
    fAS_ID = new VLookup("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.setBackground(AdempierePLAF.getInfoBackground());
    fAS_ID.addActionListener(this);
    //
    labelASI.setText(Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID"));
    MPAttributeLookup mpaLookup = new MPAttributeLookup(Env.getCtx(), p_WindowNo);
    fASI_ID = new VPAttribute((GridTab) null, false, false, true, p_WindowNo, mpaLookup, true);
    fASI_ID.setBackground(AdempierePLAF.getInfoBackground());
    fASI_ID.addActionListener(this);
    labelVendor.setText(Msg.translate(Env.getCtx(), "Vendor"));
    fVendor_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MProductPO.Table_Name, MProductPO.COLUMNNAME_C_BPartner_ID), DisplayType.Search));
    fVendor_ID.setBackground(AdempierePLAF.getInfoBackground());
    fVendor_ID.addActionListener(this);
    // Override the isSOTrx context, Vendors only
    fVendor_ID.setIsSOTrx(true, false);
    //  Setup the Grid
    //	Line 1
    p_criteriaGrid.add(labelValue, new ALayoutConstraint(0, 0));
    p_criteriaGrid.add(fieldValue, null);
    p_criteriaGrid.add(labelWarehouse, null);
    p_criteriaGrid.add(fWarehouse_ID, null);
    p_criteriaGrid.add(checkOnlyStock, new ALayoutConstraint(0, 5));
    //	Line 2
    p_criteriaGrid.add(labelName, new ALayoutConstraint(1, 0));
    p_criteriaGrid.add(fieldName, null);
    p_criteriaGrid.add(labelPriceList, null);
    p_criteriaGrid.add(fPriceList_ID, null);
    // @Trifon
    p_criteriaGrid.add(labelAS, null);
    // @Trifon
    p_criteriaGrid.add(fAS_ID, null);
    // Line 3
    p_criteriaGrid.add(labelUPC, new ALayoutConstraint(2, 0));
    p_criteriaGrid.add(fieldUPC, null);
    p_criteriaGrid.add(labelProductCategory, null);
    p_criteriaGrid.add(fProductCategory_ID, null);
    p_criteriaGrid.add(labelASI, null);
    p_criteriaGrid.add(fASI_ID, null);
    //  Line 4
    p_criteriaGrid.add(labelSKU, new ALayoutConstraint(3, 0));
    p_criteriaGrid.add(fieldSKU, null);
    p_criteriaGrid.add(labelVendor, null);
    p_criteriaGrid.add(fVendor_ID, null);
    p_criteriaGrid.add(checkAND, new ALayoutConstraint(3, 5));
    //	Product Attribute Instance
    m_PAttributeButton = ConfirmPanel.createPAttributeButton(true);
    confirmPanel.addButton(m_PAttributeButton);
    m_PAttributeButton.addActionListener(this);
    m_PAttributeButton.setEnabled(false);
    //Begin - fer_luck @ centuryon
    //add taskpane
    fieldDescription.setBackground(AdempierePLAF.getInfoBackground());
    fieldDescription.setEditable(false);
    fieldDescription.setPreferredSize(new Dimension(INFO_WIDTH - 100, 100));
    fieldPAttributes.setBackground(AdempierePLAF.getInfoBackground());
    fieldPAttributes.setEditable(false);
    fieldPAttributes.setPreferredSize(new Dimension(INFO_WIDTH - 100, 100));
    ColumnInfo[] s_layoutWarehouse = new ColumnInfo[] { new ColumnInfo(" ", "M_Warehouse_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "WarehouseName"), "WarehouseName", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "sum(QtyAvailable)", Double.class, true, true, null), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "sum(QtyOnHand)", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "sum(QtyReserved)", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOrdered"), "sum(QtyOrdered)", Double.class) };
    //        		new ColumnInfo(Msg.translate(Env.getCtx(), "DocumentNote"), "DocumentNote", String.class)};
    /**	From Clause							*/
    String s_sqlFrom = " M_PRODUCT_STOCK_V ";
    /** Where Clause						*/
    String s_sqlWhere = "(QtyOnHand <> 0 OR QtyAvailable <> 0 OR QtyReserved <> 0 OR QtyOrdered <> 0) AND M_Product_ID = ?";
    m_sqlWarehouse = warehouseTbl.prepareTable(s_layoutWarehouse, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_STOCK_V");
    m_sqlWarehouse += " Group By M_Warehouse_ID, WarehouseName ";
    m_sqlWarehouse += " Order By sum(QtyOnHand) DESC, WarehouseName ";
    warehouseTbl.setRowSelectionAllowed(true);
    warehouseTbl.setMultiSelection(false);
    warehouseTbl.addMouseListener(this);
    warehouseTbl.setShowTotals(true);
    warehouseTbl.autoSize();
    ColumnInfo[] s_layoutSubstitute = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Description"), "description", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Value"), "value", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class, true, true, null), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class) };
    s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V";
    s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'";
    m_sqlSubstitute = substituteTbl.prepareTable(s_layoutSubstitute, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
    substituteTbl.setRowSelectionAllowed(false);
    substituteTbl.setMultiSelection(false);
    substituteTbl.addMouseListener(this);
    substituteTbl.setShowTotals(false);
    substituteTbl.autoSize();
    ColumnInfo[] s_layoutRelated = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Description"), "description", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Value"), "value", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class, true, true, null), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class) };
    s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V";
    s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'";
    m_sqlRelated = relatedTbl.prepareTable(s_layoutRelated, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
    relatedTbl.setRowSelectionAllowed(false);
    relatedTbl.setMultiSelection(false);
    relatedTbl.addMouseListener(this);
    relatedTbl.setShowTotals(false);
    relatedTbl.autoSize();
    //Available to Promise Tab
    initAtpTab();
    m_tableAtp.setRowSelectionAllowed(false);
    m_tableAtp.setMultiSelection(false);
    //Vendor tab
    ColumnInfo[] s_layoutVendor = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "Vendor"), "(SELECT bp.Name FROM C_BPartner bp WHERE bp.C_BPartner_ID = M_PRODUCT_PO.C_BPartner_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsCurrentVendor"), "IsCurrentVendor", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_UOM_ID"), "(SELECT Name FROM C_UOM WHERE C_UOM_ID = M_PRODUCT_PO.C_UOM_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_Currency_ID"), "(SELECT iso_code FROM C_Currency WHERE C_Currency_ID = M_PRODUCT_PO.C_Currency_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PriceList"), "PriceList", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PricePO"), "PricePO", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "VendorProductNo"), "VendorProductNo", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Order_Min"), "Order_Min", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "DeliveryTime_Promised"), "DeliveryTime_Promised", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "DeliveryTime_Actual"), "DeliveryTime_Actual", Double.class) };
    s_sqlFrom = "M_PRODUCT_PO";
    s_sqlWhere = "M_Product_ID = ?";
    m_sqlVendor = vendorTbl.prepareTable(s_layoutVendor, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_PO");
    vendorTbl.setRowSelectionAllowed(false);
    vendorTbl.setMultiSelection(false);
    vendorTbl.addMouseListener(this);
    vendorTbl.setShowTotals(false);
    vendorTbl.autoSize();
    jTab.addTab(Msg.translate(Env.getCtx(), "Warehouse"), new JScrollPane(warehouseTbl));
    jTab.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 250 : 105));
    jTab.addTab(Msg.translate(Env.getCtx(), "Description"), new JScrollPane(fieldDescription));
    jTab.addTab(Msg.translate(Env.getCtx(), "ProductAttribute"), new JScrollPane(fieldPAttributes));
    jTab.addTab(Msg.translate(Env.getCtx(), "Substitute_ID"), new JScrollPane(substituteTbl));
    jTab.addTab(Msg.translate(Env.getCtx(), "RelatedProduct_ID"), new JScrollPane(relatedTbl));
    jTab.addTab(Msg.getMsg(Env.getCtx(), "ATP"), new JScrollPane(m_tableAtp));
    jTab.addTab(Msg.translate(Env.getCtx(), "Vendor"), new JScrollPane(vendorTbl));
    jTab.addChangeListener(this);
    tablePanel.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 255 : 110));
    tablePanel.setLayout(new BorderLayout());
    tablePanel.add(jTab, BorderLayout.CENTER);
    //  Add the details to the p_detailPanel
    p_detailTaskPane.setTitle(Msg.translate(Env.getCtx(), "WarehouseStock"));
    p_detailTaskPane.add(checkShowDetail, BorderLayout.NORTH);
    p_detailTaskPane.add(tablePanel, BorderLayout.CENTER);
    p_detailTaskPane.setVisible(true);
}
Also used : JScrollPane(javax.swing.JScrollPane) VPAttribute(org.compiere.grid.ed.VPAttribute) BorderLayout(java.awt.BorderLayout) GridTab(org.compiere.model.GridTab) VLookup(org.compiere.grid.ed.VLookup) ALayoutConstraint(org.compiere.apps.ALayoutConstraint) ColumnInfo(org.compiere.minigrid.ColumnInfo) Dimension(java.awt.Dimension) MPAttributeLookup(org.compiere.model.MPAttributeLookup)

Example 5 with GridTab

use of org.compiere.model.GridTab in project adempiere by adempiere.

the class WWindow method getSR_Form.

//  getFieldValue
/**************************************************************************
	 *	Return SingleRow Form details
	 *  @param action action
	 *  @param wsc web session context
	 *  @param ws window status
	 *  @return Form
	 */
public MobileDoc getSR_Form(String action, MobileSessionCtx wsc, WWindowStatus ws) {
    log.fine("Tab=" + ws.curTab.getTabNo());
    form line = new form("WWindow");
    line.addAttribute("selected", "true");
    line.setClass("panel");
    line.setMethod("post");
    line.setTitle(ws.curTab.getName());
    // line.setTarget("_self");
    fs = new fieldset();
    line.addElement(fs);
    /**********************
		 *  For all Fields
		 */
    StringBuffer scriptSrc = new StringBuffer();
    MRole role = MRole.getDefault(wsc.ctx, false);
    //
    //Modified by Rob Klein 4/29/07
    m_searchField = null;
    boolean isTabRO = ws.isReadOnlyView();
    if (ws.curTab.isDisplayed()) {
        int noFields = ws.curTab.getFieldCount();
        for (int i = 0; i < noFields; i++) {
            GridField field = ws.curTab.getField(i);
            String columnName = field.getColumnName();
            /**
				 *  Get Data and convert to String (singleRow)
				 */
            Object oData = ws.curTab.getValue(field);
            //Modified by Rob Klein 4/29/07
            /**
				 *  Get Record ID and Table ID for Processes
				 */
            int recordID = ws.curTab.getRecord_ID();
            int tableID = ws.curTab.getAD_Table_ID();
            /**
				 *  Display field
				 */
            if (field.isDisplayed(true) && field.getDisplayType() != DisplayType.Button) {
                /* todo chart support
					if ( ws.isReadOnlyView() && field.getDisplayType()== 53370 )
					{
						img chart = getChart(field.getAD_Chart_ID(), sess);
						div div = new div();
						div.setClass("row");
						if ( chart != null )
						{
							div.addElement(chart);
							fs.addElement(div);
						}
					}
					else */
                {
                    //
                    boolean hasDependents = ws.curTab.hasDependants(columnName);
                    //Modified by Rob Klein 4/29/07
                    addField(wsc, line, field, oData, hasDependents, recordID, tableID, isTabRO, i, ws.curTab, role);
                    //  Additional Values
                    String dispLogic = field.getDisplayLogic();
                    if (dispLogic != null && dispLogic.length() > 0) {
                        //  replace ' with "
                        dispLogic = dispLogic.replace('\'', '"');
                        scriptSrc.append("document.").append(FORM_NAME).append(".").append(columnName).append(".displayLogic='").append(dispLogic).append("';\n");
                    }
                }
            }
        }
    //	for all fields			
    }
    //	displayed
    /*if (scriptSrc.length() > 0)
			table.addElement(new script(scriptSrc.toString()));*/
    //  Status Line
    int rowNo = ws.curTab.getCurrentRow();
    String statusDB = String.valueOf(rowNo + 1) + " / " + ws.curTab.getRowCount();
    // return createLayout (action, new ul(), wsc, ws, ws.curTab.getDescription(), statusDB);
    if (ws.isReadOnlyView()) {
        for (int i = ws.curTab.getTabNo() + 1; i < ws.mWindow.getTabCount(); i++) {
            GridTab tab = ws.mWindow.getTab(i);
            if (tab.getTabNo() >= ws.curTab.getTabNo() && tab.getTabLevel() <= ws.curTab.getTabLevel())
                // past all children of curTab
                break;
            if (tab.getTabLevel() != ws.curTab.getTabLevel() + 1)
                // not direct child
                continue;
            if (tab.isSortTab())
                continue;
            //Modified by Rob Klein 4/29/07
            a big = new a("WWindow?tab=" + i, tab.getName());
            big.setClass("whiteButton");
            big.setTarget("_self");
            line.addElement(big);
        }
    }
    if (!ws.isReadOnlyView()) {
        a button = new a("#", "Save");
        button.addAttribute("type", "submit");
        button.setClass("redButton");
        // a.setTarget("_self");
        line.addElement(button);
    }
    MobileDoc doc = createPage(ws);
    doc.getBody().addElement(line);
    div div = new div();
    div.setClass("toolbar");
    h1 header = new h1();
    header.setID("pageTitle");
    div.addElement(header);
    a anchor = new a();
    anchor.setClass("button");
    anchor.setHref(MobileEnv.getBaseDirectory("WMenu"));
    anchor.setTarget("_self");
    anchor.addElement("Menu");
    div.addElement(anchor);
    anchor = new a("WWindow?action=list", "Back");
    anchor.setID("previousButton");
    anchor.setClass("button");
    anchor.setTarget("_self");
    div.addElement(anchor);
    doc.getBody().addElement(div);
    if (!ws.curTab.isReadOnly() && ws.isReadOnlyView()) {
        div = new div();
        div.setClass("footer");
        a a = new a("WWindow?action=edit", "Edit");
        a.setClass("redButton");
        a.setTarget("_self");
        div.addElement(a);
        doc.getBody().addElement(div);
    }
    return doc;
}
Also used : org.apache.ecs.xhtml.a(org.apache.ecs.xhtml.a) MRole(org.compiere.model.MRole) org.apache.ecs.xhtml.fieldset(org.apache.ecs.xhtml.fieldset) org.apache.ecs.xhtml.h1(org.apache.ecs.xhtml.h1) GridField(org.compiere.model.GridField) org.apache.ecs.xhtml.div(org.apache.ecs.xhtml.div) org.apache.ecs.xhtml.form(org.apache.ecs.xhtml.form) GridTab(org.compiere.model.GridTab)

Aggregations

GridTab (org.compiere.model.GridTab)38 GridField (org.compiere.model.GridField)10 MQuery (org.compiere.model.MQuery)8 AdempiereException (org.adempiere.exceptions.AdempiereException)4 Point (java.awt.Point)3 MRole (org.compiere.model.MRole)3 PO (org.compiere.model.PO)3 Dimension (java.awt.Dimension)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 MBrowse (org.adempiere.model.MBrowse)2 ProcessModalDialog (org.adempiere.webui.apps.ProcessModalDialog)2 org.apache.ecs.xhtml.a (org.apache.ecs.xhtml.a)2 org.apache.ecs.xhtml.div (org.apache.ecs.xhtml.div)2 org.apache.ecs.xhtml.form (org.apache.ecs.xhtml.form)2 GridController (org.compiere.grid.GridController)2 ICreateFrom (org.compiere.grid.ICreateFrom)2 GridTable (org.compiere.model.GridTable)2 MOrderLine (org.compiere.model.MOrderLine)2