Search in sources :

Example 11 with Rows

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

the class WStocktake method zkInit.

//	init
/**
	 *  Static Init
	 *  @throws Exception
	 */
void zkInit() throws Exception {
    form.appendChild(mainPanel);
    mainPanel.setStyle("width: 99%; height: 100%; border: none; padding: 0; margin: 0");
    mainPanel.appendChild(mainLayout);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    parameterPanel.appendChild(parameterLayout);
    //
    inventoryLabel.setText(Msg.translate(Env.getCtx(), "M_Inventory_ID"));
    locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    productLabel.setText(Msg.translate(Env.getCtx(), "M_Product_ID"));
    lineFLabel.setText(Msg.translate(Env.getCtx(), "Line") + " " + Msg.translate(Env.getCtx(), "From"));
    lineTLabel.setText(Msg.translate(Env.getCtx(), "Line") + " " + Msg.translate(Env.getCtx(), "To"));
    aislexLabel.setText(Msg.translate(Env.getCtx(), "X"));
    //
    North north = new North();
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);
    Rows rows = parameterLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(inventoryLabel.rightAlign());
    row.appendChild(inventoryField.getComponent());
    row.appendChild(lineFLabel.rightAlign());
    row.appendChild(lineFField.getComponent());
    row.appendChild(lineTLabel.rightAlign());
    row.appendChild(lineTField.getComponent());
    row.appendChild(secondCount);
    row = rows.newRow();
    row.appendChild(aislexLabel.rightAlign());
    row.appendChild(aislexField.getComponent());
    row.appendChild(productLabel.rightAlign());
    row.appendChild(productField.getComponent());
    row.appendChild(locatorLabel.rightAlign());
    row.appendChild(locatorField.getComponent());
    //
    secondCount.setText(Msg.getMsg(Env.getCtx(), "Second Count"));
    secondCount.addActionListener(this);
    confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setLabel(Msg.translate(Env.getCtx(), "CountEntered"));
    southPanel.appendChild(confirmPanel);
    southPanel.appendChild(new Separator());
    southPanel.appendChild(statusBar);
    South south = new South();
    south.setStyle("border: none");
    mainLayout.appendChild(south);
    south.appendChild(southPanel);
    LayoutUtils.addSclass("status-border", statusBar);
}
Also used : South(org.zkoss.zkex.zul.South) North(org.zkoss.zkex.zul.North) Row(org.adempiere.webui.component.Row) Separator(org.zkoss.zul.Separator) Rows(org.adempiere.webui.component.Rows)

Example 12 with Rows

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

the class WTrxMaterial method zkInit.

//	init
/**
	 *  Static Init
	 *  @throws Exception
	 */
void zkInit() throws Exception {
    form.appendChild(mainPanel);
    mainPanel.setStyle("width: 99%; height: 100%; border: none; padding: 0; margin: 0");
    mainPanel.appendChild(mainLayout);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    parameterPanel.appendChild(parameterLayout);
    //
    orgLabel.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
    locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    productLabel.setText(Msg.translate(Env.getCtx(), "Product"));
    dateFLabel.setText(Msg.translate(Env.getCtx(), "DateFrom"));
    dateTLabel.setText(Msg.translate(Env.getCtx(), "DateTo"));
    mtypeLabel.setText(Msg.translate(Env.getCtx(), "MovementType"));
    //
    North north = new North();
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);
    Rows rows = parameterLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(orgLabel.rightAlign());
    row.appendChild(orgField.getComponent());
    row.appendChild(mtypeLabel.rightAlign());
    row.appendChild(mtypeField.getComponent());
    row.appendChild(dateFLabel.rightAlign());
    row.appendChild(dateFField.getComponent());
    row = rows.newRow();
    row.appendChild(locatorLabel.rightAlign());
    row.appendChild(locatorField.getComponent());
    row.appendChild(productLabel.rightAlign());
    row.appendChild(productField.getComponent());
    row.appendChild(dateTLabel.rightAlign());
    row.appendChild(dateTField.getComponent());
    //
    southPanel.appendChild(confirmPanel);
    southPanel.appendChild(new Separator());
    southPanel.appendChild(statusBar);
    South south = new South();
    south.setStyle("border: none");
    mainLayout.appendChild(south);
    south.appendChild(southPanel);
    LayoutUtils.addSclass("status-border", statusBar);
}
Also used : South(org.zkoss.zkex.zul.South) North(org.zkoss.zkex.zul.North) Row(org.adempiere.webui.component.Row) Separator(org.zkoss.zul.Separator) Rows(org.adempiere.webui.component.Rows)

Example 13 with Rows

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

the class WWFActivity method init.

private void init() {
    Grid grid = new Grid();
    grid.setWidth("100%");
    grid.setHeight("100%");
    grid.setStyle("margin:0; padding:0; position: absolute; align: center; valign: center;");
    grid.makeNoStrip();
    grid.setOddRowSclass("even");
    Rows rows = new Rows();
    grid.appendChild(rows);
    Row row = new Row();
    rows.appendChild(row);
    Div div = new Div();
    div.setAlign("right");
    div.appendChild(lNode);
    row.appendChild(div);
    row.appendChild(fNode);
    fNode.setWidth("100%");
    fNode.setReadonly(true);
    row = new Row();
    rows.appendChild(row);
    row.setValign("top");
    div = new Div();
    div.setAlign("right");
    div.appendChild(lDesctiption);
    row.appendChild(div);
    row.appendChild(fDescription);
    fDescription.setMultiline(true);
    fDescription.setWidth("100%");
    fDescription.setReadonly(true);
    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lHelp);
    row.appendChild(div);
    row.appendChild(fHelp);
    fHelp.setMultiline(true);
    fHelp.setWidth("100%");
    fHelp.setReadonly(true);
    fHelp.setRows(3);
    row.appendChild(new Label());
    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lHistory);
    row.appendChild(div);
    row.appendChild(fHistory);
    row.appendChild(new Label());
    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lAnswer);
    row.appendChild(div);
    Hbox hbox = new Hbox();
    hbox.appendChild(fAnswerText);
    hbox.appendChild(fAnswerList);
    hbox.appendChild(fAnswerButton);
    fAnswerButton.addEventListener(Events.ON_CLICK, this);
    row.appendChild(hbox);
    row.appendChild(bZoom);
    bZoom.addEventListener(Events.ON_CLICK, this);
    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lTextMsg);
    row.appendChild(div);
    row.appendChild(fTextMsg);
    fTextMsg.setMultiline(true);
    fTextMsg.setWidth("100%");
    row.appendChild(new Label());
    row = new Row();
    rows.appendChild(row);
    div = new Div();
    div.setAlign("right");
    div.appendChild(lForward);
    row.appendChild(div);
    hbox = new Hbox();
    hbox.appendChild(fForward.getComponent());
    hbox.appendChild(lOptional);
    row.appendChild(hbox);
    row.appendChild(bOK);
    bOK.addEventListener(Events.ON_CLICK, this);
    Borderlayout layout = new Borderlayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setStyle("background-color: transparent; position: absolute;");
    North north = new North();
    north.appendChild(listbox);
    north.setSplittable(true);
    north.setHflex("true");
    //north.setVflex("true");
    north.setHeight("50%");
    layout.appendChild(north);
    north.setStyle("background-color: transparent");
    listbox.addEventListener(Events.ON_SELECT, this);
    Center center = new Center();
    center.appendChild(grid);
    layout.appendChild(center);
    center.setStyle("background-color: transparent");
    center.setHflex("true");
    center.setVflex("true");
    South south = new South();
    south.appendChild(statusBar);
    layout.appendChild(south);
    south.setStyle("background-color: transparent");
    this.appendChild(layout);
    this.setStyle("height: 100%; width: 100%; position: absolute;");
}
Also used : Div(org.zkoss.zul.Div) Hbox(org.zkoss.zul.Hbox) Center(org.zkoss.zul.Center) Grid(org.adempiere.webui.component.Grid) Label(org.adempiere.webui.component.Label) South(org.zkoss.zul.South) North(org.zkoss.zul.North) Row(org.adempiere.webui.component.Row) Borderlayout(org.zkoss.zul.Borderlayout) Rows(org.adempiere.webui.component.Rows)

Example 14 with Rows

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

the class WPAttributeDialog method initAttributes.

//	init
/**
	 *	Dyanmic Init.
	 *  @return true if initialized
	 */
private boolean initAttributes() {
    Rows rows = new Rows();
    rows.setParent(centerLayout);
    if (m_M_Product_ID == 0 && !m_productWindow)
        return false;
    MAttributeSet as = null;
    if (m_M_Product_ID != 0) {
        //	Get Model
        m_product = MProduct.get(Env.getCtx(), m_M_Product_ID);
        if (m_product.getM_AttributeSetInstance_ID() > 0) {
            m_productASI = true;
            //  The product has an instance associated with it.
            if (m_M_AttributeSetInstance_ID != m_product.getM_AttributeSetInstance_ID()) {
                log.fine("Different ASI than what is specified on Product!");
            }
        } else {
            // Only show product attributes when in the product window.
            m_productASI = m_productWindow;
        }
        m_masi = MAttributeSetInstance.get(Env.getCtx(), m_M_AttributeSetInstance_ID, m_M_Product_ID);
        if (m_masi == null) {
            log.severe("No Model for M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + ", M_Product_ID=" + m_M_Product_ID);
            return false;
        }
        Env.setContext(Env.getCtx(), m_WindowNo, "M_AttributeSet_ID", m_masi.getM_AttributeSet_ID());
        //	Get Attribute Set
        as = m_masi.getMAttributeSet();
    } else {
        int M_AttributeSet_ID = Env.getContextAsInt(Env.getCtx(), m_WindowNoParent, "M_AttributeSet_ID");
        m_masi = new MAttributeSetInstance(Env.getCtx(), 0, M_AttributeSet_ID, null);
        as = m_masi.getMAttributeSet();
    }
    //	Product has no Attribute Set
    if (as == null) {
        FDialog.error(m_WindowNo, this, "PAttributeNoAttributeSet");
        return false;
    }
    //  always read/write.  The two are exclusive and can't co-exists.  
    if (//	Set Instance Attributes and dialog controls
    !m_productWindow || !m_productASI) {
        if (// Instance attributes possible.  Set up controls.
        !m_productASI) {
            Row row = new Row();
            //	New/Edit - Selection
            if (//	new
            m_M_AttributeSetInstance_ID == 0)
                cbNewEdit.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "NewRecord")));
            else
                cbNewEdit.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "EditRecord")));
            cbNewEdit.addEventListener(Events.ON_CHECK, this);
            row.appendChild(cbNewEdit);
            bSelect.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "SelectExisting")));
            bSelect.setImage(ServletFns.resolveThemeURL("~./images/PAttribute16.png"));
            bSelect.addEventListener(Events.ON_CLICK, this);
            row.appendChild(bSelect);
            rows.appendChild(row);
        }
        //	Add the Instance Attributes if any.  If its a product attribute set
        //  this will do nothing.
        // True = Instances
        MAttribute[] attributes = as.getMAttributes(true);
        log.fine("Instance Attributes=" + attributes.length);
        for (int i = 0; i < attributes.length; i++) addAttributeLine(rows, attributes[i], false, false);
    }
    //  Product attributes can be shown in any window but are read/write in the Product window only.
    //  This will do nothing if it is an instance attribute set. 
    // False = products
    MAttribute[] attributes = as.getMAttributes(false);
    log.fine("Product Attributes=" + attributes.length);
    for (int i = 0; i < attributes.length; i++) addAttributeLine(rows, attributes[i], true, !m_productWindow);
    //	Lot
    if ((!m_productWindow || !m_productASI) && as.isLot()) {
        Row row = new Row();
        row.setParent(rows);
        m_row++;
        Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "Lot")));
        row.appendChild(label);
        row.appendChild(fieldLotString);
        fieldLotString.setText(m_masi.getLot());
        //	M_Lot_ID
        //	int AD_Column_ID = 9771;	//	M_AttributeSetInstance.M_Lot_ID
        //	fieldLot = new VLookup ("M_Lot_ID", false,false, true, 
        //		MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, AD_Column_ID, DisplayType.TableDir));
        String sql = "SELECT M_Lot_ID, Name " + "FROM M_Lot l " + "WHERE EXISTS (SELECT M_Product_ID FROM M_Product p " + "WHERE p.M_AttributeSet_ID=" + m_masi.getM_AttributeSet_ID() + " AND p.M_Product_ID=l.M_Product_ID)";
        fieldLot = new Listbox();
        fieldLot.setMold("select");
        KeyNamePair[] keyNamePairs = DB.getKeyNamePairs(sql, true);
        for (KeyNamePair pair : keyNamePairs) {
            fieldLot.appendItem(pair.getName(), pair.getKey());
        }
        label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "M_Lot_ID")));
        row = new Row();
        row.setParent(rows);
        m_row++;
        row.appendChild(label);
        row.appendChild(fieldLot);
        if (m_masi.getM_Lot_ID() != 0) {
            for (int i = 1; i < fieldLot.getItemCount(); i++) {
                ListItem pp = fieldLot.getItemAtIndex(i);
                if ((Integer) pp.getValue() == m_masi.getM_Lot_ID()) {
                    fieldLot.setSelectedIndex(i);
                    fieldLotString.setReadonly(true);
                    break;
                }
            }
        }
        fieldLot.addEventListener(Events.ON_SELECT, this);
        //	New Lot Button
        if (m_masi.getMAttributeSet().getM_LotCtl_ID() != 0) {
            if (MRole.getDefault().isTableAccess(MLot.Table_ID, false) && MRole.getDefault().isTableAccess(MLotCtl.Table_ID, false) && !m_masi.isExcludeLot(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNoParent))) {
                row = new Row();
                row.setParent(rows);
                m_row++;
                row.appendChild(bLot);
                bLot.addEventListener(Events.ON_CLICK, this);
            }
        }
        //	Popup 
        //			fieldLot.addMouseListener(new VPAttributeDialog_mouseAdapter(this));    //  popup
        mZoom = new Menuitem(Msg.getMsg(Env.getCtx(), "Zoom"), ServletFns.resolveThemeURL("~./images/Zoom16.png"));
        mZoom.addEventListener(Events.ON_CLICK, this);
        popupMenu.appendChild(mZoom);
        this.appendChild(popupMenu);
    }
    //	SerNo
    if ((!m_productWindow || !m_productASI) && as.isSerNo()) {
        Row row = new Row();
        row.setParent(rows);
        m_row++;
        Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "SerNo")));
        row.appendChild(label);
        row.appendChild(fieldSerNo);
        fieldSerNo.setText(m_masi.getSerNo());
        //	New SerNo Button
        if (m_masi.getMAttributeSet().getM_SerNoCtl_ID() != 0) {
            if (MRole.getDefault().isTableAccess(MSerNoCtl.Table_ID, false) && !m_masi.isExcludeSerNo(m_AD_Column_ID, Env.isSOTrx(Env.getCtx(), m_WindowNoParent))) {
                row = new Row();
                row.setParent(rows);
                m_row++;
                row.appendChild(bSerNo);
                bSerNo.addEventListener(Events.ON_CLICK, this);
            }
        }
    }
    //	GuaranteeDate
    if ((!m_productWindow || !m_productASI) && as.isGuaranteeDate()) {
        Row row = new Row();
        row.setParent(rows);
        m_row++;
        Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "GuaranteeDate")));
        if (m_M_AttributeSetInstance_ID == 0)
            fieldGuaranteeDate.setValue(m_masi.getGuaranteeDate(true));
        else
            fieldGuaranteeDate.setValue(m_masi.getGuaranteeDate());
        row.appendChild(label);
        row.appendChild(fieldGuaranteeDate);
    }
    if (m_row == 0) {
        FDialog.error(m_WindowNo, this, "PAttributeNoInfo");
        return false;
    }
    //	New/Edit Window
    if (!m_productWindow) {
        cbNewEdit.setChecked(m_M_AttributeSetInstance_ID == 0);
        cmd_newEdit();
    }
    //	Attrribute Set Instance Description
    Label label = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "Description")));
    //		label.setLabelFor(fieldDescription);
    fieldDescription.setText(m_masi.getDescription());
    fieldDescription.setReadonly(true);
    Row row = new Row();
    row.setParent(rows);
    row.appendChild(label);
    row.appendChild(fieldDescription);
    return true;
}
Also used : Label(org.adempiere.webui.component.Label) MAttributeSetInstance(org.compiere.model.MAttributeSetInstance) MAttributeSet(org.compiere.model.MAttributeSet) Menuitem(org.zkoss.zul.Menuitem) Row(org.adempiere.webui.component.Row) KeyNamePair(org.compiere.util.KeyNamePair) ListItem(org.adempiere.webui.component.ListItem) Listbox(org.adempiere.webui.component.Listbox) Rows(org.adempiere.webui.component.Rows) MAttribute(org.compiere.model.MAttribute)

Example 15 with Rows

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

the class WAssignmentDialog method init.

/**
	 * 	Static Init
	 * 	@throws Exception
	 */
private void init() throws Exception {
    fResource.setMold("select");
    fResource.addEventListener(Events.ON_SELECT, this);
    delete.addEventListener(Events.ON_CLICK, this);
    confirmPanel.addComponentsLeft(delete);
    confirmPanel.addActionListener(Events.ON_CLICK, this);
    //
    this.appendChild(mainPanel);
    mainPanel.makeNoStrip();
    mainPanel.setStyle("background-color: transparent");
    Rows rows = new Rows();
    mainPanel.appendChild(rows);
    Row row = new Row();
    row.appendChild(ThemeUtils.makeRightAlign(lResource));
    row.appendChild(fResource);
    row.appendChild(new Label(" "));
    rows.appendChild(row);
    row = new Row();
    row.setSpans("1, 2");
    row.appendChild(ThemeUtils.makeRightAlign(lDate));
    Div div = new Div();
    div.appendChild(fDateFrom);
    div.appendChild(fTimeFrom);
    fTimeFrom.setStyle("margin-left: 1px");
    row.appendChild(div);
    rows.appendChild(row);
    row = new Row();
    row.appendChild(ThemeUtils.makeRightAlign(lQty));
    row.appendChild(fQty);
    row.appendChild(lUOM);
    rows.appendChild(row);
    row = new Row();
    row.setSpans("1, 2");
    row.appendChild(ThemeUtils.makeRightAlign(lName));
    row.appendChild(fName);
    fName.setStyle("width: 100%");
    rows.appendChild(row);
    row = new Row();
    row.setSpans("1, 2");
    row.appendChild(ThemeUtils.makeRightAlign(lDescription));
    row.appendChild(fDescription);
    fDescription.setMultiline(true);
    fDescription.setRows(3);
    fDescription.setStyle("width: 100%");
    rows.appendChild(row);
    row = new Row();
    row.setSpans("3");
    row.appendChild(new Label(" "));
    rows.appendChild(row);
    row = new Row();
    row.setSpans("3");
    row.appendChild(confirmPanel);
    rows.appendChild(row);
//
}
Also used : Div(org.zkoss.zul.Div) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Aggregations

Rows (org.adempiere.webui.component.Rows)76 Row (org.adempiere.webui.component.Row)69 Label (org.adempiere.webui.component.Label)28 Grid (org.adempiere.webui.component.Grid)27 Panel (org.adempiere.webui.component.Panel)20 Center (org.zkoss.zul.Center)17 Div (org.zkoss.zul.Div)15 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)13 Hbox (org.zkoss.zul.Hbox)13 Space (org.zkoss.zul.Space)13 South (org.zkoss.zul.South)12 Center (org.zkoss.zkex.zul.Center)11 North (org.zkoss.zul.North)11 North (org.zkoss.zkex.zul.North)10 Borderlayout (org.zkoss.zul.Borderlayout)10 Separator (org.zkoss.zul.Separator)10 South (org.zkoss.zkex.zul.South)8 Caption (org.zkoss.zul.Caption)6 Tab (org.adempiere.webui.component.Tab)5 Row (org.zkoss.zul.Row)5