Search in sources :

Example 76 with Row

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

the class InfoAssetPanel method statInit.

// InfoAssetPanel
/**
	 *	Static Setup - add fields to parameterPanel
	 */
private void statInit() {
    fieldValue.setWidth("100%");
    fieldName.setWidth("100%");
    labelValue.setValue(Msg.getMsg(Env.getCtx(), "Value"));
    fieldValue.addEventListener(Events.ON_CHANGE, this);
    fieldValue.setAttribute("zk_component_ID", "Lookup_Criteria_fieldValue");
    labelName.setValue(Msg.getMsg(Env.getCtx(), "Name"));
    fieldName.addEventListener(Events.ON_CANCEL, this);
    fieldName.setAttribute("zk_component_ID", "Lookup_Criteria_fieldName");
    // From A_Asset.
    fBPartner_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(I_A_Asset.Table_Name, I_A_Asset.COLUMNNAME_C_BPartner_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_BPartner_ID"), "", false, false, true);
    fBPartner_ID.addValueChangeListener(this);
    fBPartner_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_fBPartner_ID");
    fProduct_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(I_A_Asset.Table_Name, I_A_Asset.COLUMNNAME_M_Product_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "M_Product_ID"), "", false, false, true);
    fProduct_ID.addValueChangeListener(this);
    fProduct_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_fProduct_ID");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(labelValue.rightAlign());
    row.appendChild(fieldValue);
    row.appendChild(fBPartner_ID.getLabel().rightAlign());
    row.appendChild(fBPartner_ID.getComponent());
    row = new Row();
    rows.appendChild(row);
    row.appendChild(labelName.rightAlign());
    row.appendChild(fieldName);
    row.appendChild(fProduct_ID.getLabel().rightAlign());
    row.appendChild(fProduct_ID.getComponent());
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
}
Also used : WSearchEditor(org.adempiere.webui.editor.WSearchEditor) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 77 with Row

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

the class InfoAssignmentPanel method statInit.

// InfoAssignmentPanel
/**
	 *	Static Setup - add fields to parameterPanel.
	 *  <pre>
	 * 		ResourceType	Resource	DateTimeFrom	DateTimeTo	New
	 *  </pre>
	 */
private void statInit() {
    fieldResourceType = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MResourceType.Table_Name, MResourceType.COLUMNNAME_S_ResourceType_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "S_ResourceType_ID"), "", false, false, true);
    fieldResourceType.getComponent().addEventListener(Events.ON_CHANGE, this);
    ;
    fieldResourceType.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_S_ResourceType_ID");
    fieldResource = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MResource.Table_Name, MResource.COLUMNNAME_S_Resource_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "S_Resource_ID"), "", false, false, true);
    fieldResource.getComponent().addEventListener(Events.ON_CHANGE, this);
    fieldResource.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_S_Resource_ID");
    bNew.setImage(ServletFns.resolveThemeURL("~./images/New16.png"));
    fieldFrom.setWidth("180px");
    fieldTo.setWidth("180px");
    fieldFrom.setAttribute("zk_component_ID", "Lookup_Criteria_fieldFrom");
    fieldFrom.addEventListener(Events.ON_CHANGE, this);
    fieldTo.setAttribute("zk_component_ID", "Lookup_Criteria_fieldTo");
    fieldTo.addEventListener(Events.ON_CHANGE, this);
    SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
    fieldFrom.setFormat(dateFormat.toPattern());
    fieldTo.setFormat(dateFormat.toPattern());
    bNew.addEventListener(Events.ON_CLICK, this);
    bNew.setAttribute("zk_component_ID", "Lookup_Criteria_bNew");
    Rows rows = new Rows();
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(fieldResourceType.getLabel().rightAlign());
    row.appendChild(fieldResource.getLabel().rightAlign());
    row.appendChild(labelFrom.rightAlign());
    row.appendChild(labelTo.rightAlign());
    row.appendChild(new Label());
    row = new Row();
    rows.appendChild(row);
    row.appendChild(fieldResourceType.getComponent());
    row.appendChild(fieldResource.getComponent());
    Div div = new Div();
    div.setAlign("right");
    div.appendChild(fieldFrom);
    row.appendChild(div);
    div = new Div();
    div.setAlign("right");
    div.appendChild(fieldTo);
    row.appendChild(div);
    row.appendChild(bNew);
    p_criteriaGrid.appendChild(rows);
    super.setSizes();
}
Also used : WTableDirEditor(org.adempiere.webui.editor.WTableDirEditor) Div(org.zkoss.zul.Div) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) SimpleDateFormat(java.text.SimpleDateFormat) Rows(org.adempiere.webui.component.Rows)

Example 78 with Row

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

the class WRecordAccessDialog method jbInit.

//	dynInit
/**
	 * 	Static Init
	 *	@throws Exception
	 */
private void jbInit() throws Exception {
    bDelete.setImage(ServletFns.resolveThemeURL("~./images/Delete16.png"));
    bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
    bNew.setImage(ServletFns.resolveThemeURL("~./images/New16.png"));
    bNew.setTooltiptext(Msg.getMsg(Env.getCtx(), "New"));
    bUp.setImage(ServletFns.resolveThemeURL("~./images/Previous16.png"));
    bUp.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous"));
    bDown.setImage(ServletFns.resolveThemeURL("~./images/Next16.png"));
    bDown.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next"));
    cbActive.setText(Msg.translate(Env.getCtx(), "IsActive"));
    cbExclude.setText(Msg.translate(Env.getCtx(), "IsExclude"));
    cbReadOnly.setText(Msg.translate(Env.getCtx(), "IsReadOnly"));
    cbDependent.setText(Msg.translate(Env.getCtx(), "IsDependentEntities"));
    Grid grid = GridFactory.newGridLayout();
    this.appendChild(grid);
    Rows rows = new Rows();
    grid.appendChild(rows);
    Row row = new Row();
    rows.appendChild(row);
    row.appendChild(bUp);
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(bNew);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(roleLabel);
    row.appendChild(roleField);
    row.appendChild(cbActive);
    row.appendChild(cbExclude);
    row.appendChild(cbReadOnly);
    row.appendChild(cbDependent);
    row.appendChild(bDelete);
    row = new Row();
    rows.appendChild(row);
    row.appendChild(bDown);
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(new Label());
    row.appendChild(rowNoLabel);
    row = new Row();
    rows.appendChild(row);
    row.setSpans("7");
    Div div = new Div();
    div.setAlign("right");
    div.appendChild(confirmPanel);
    row.appendChild(div);
    bUp.addEventListener(Events.ON_CLICK, this);
    bDown.addEventListener(Events.ON_CLICK, this);
    bDelete.addEventListener(Events.ON_CLICK, this);
    bNew.addEventListener(Events.ON_CLICK, this);
    confirmPanel.addActionListener(this);
}
Also used : Div(org.zkoss.zul.Div) Grid(org.adempiere.webui.component.Grid) Label(org.adempiere.webui.component.Label) Row(org.adempiere.webui.component.Row) Rows(org.adempiere.webui.component.Rows)

Example 79 with Row

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

the class WLocationDialog method initLocation.

private void initLocation() {
    if (mainPanel.getRows() != null)
        mainPanel.getRows().getChildren().clear();
    MCountry country = m_location.getCountry();
    log.fine(country.getName() + ", Region=" + country.isHasRegion() + " " + country.getCaptureSequence() + ", C_Location_ID=" + m_location.getC_Location_ID());
    //  new Country
    if (m_location.getC_Country_ID() != s_oldCountry_ID) {
        lstRegion.getChildren().clear();
        if (country.isHasRegion()) {
            lstRegion.appendItem("", null);
            for (MRegion region : MRegion.getRegions(Env.getCtx(), country.getC_Country_ID())) {
                lstRegion.appendItem(region.getName(), region);
            }
            if (m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName) != null && m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName).trim().length() > 0)
                lblRegion.setValue(m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName));
            else
                lblRegion.setValue(Msg.getMsg(Env.getCtx(), "Region"));
        }
        s_oldCountry_ID = m_location.getC_Country_ID();
    }
    if (m_location.getC_Region_ID() > 0 && m_location.getC_Region().getC_Country_ID() == country.getC_Country_ID()) {
        setRegion();
    } else {
        lstRegion.setSelectedItem(null);
        m_location.setC_Region_ID(0);
    }
    if (country.isHasRegion() && m_location.getC_Region_ID() > 0) {
        Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Region_ID", String.valueOf(m_location.getC_Region_ID()));
    } else {
        Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Region_ID", "0");
    }
    Env.setContext(Env.getCtx(), m_WindowNo, Env.TAB_INFO, "C_Country_ID", String.valueOf(country.get_ID()));
    txtCity.fillList();
    //      sequence of City Postal Region - @P@ @C@ - @C@, @R@ @P@
    String ds = country.getCaptureSequence();
    if (ds == null || ds.length() == 0) {
        log.log(Level.SEVERE, "CaptureSequence empty - " + country);
        //  @C@,  @P@
        ds = "";
    }
    isCityMandatory = false;
    isRegionMandatory = false;
    isAddress1Mandatory = false;
    isAddress2Mandatory = false;
    isAddress3Mandatory = false;
    isAddress4Mandatory = false;
    isPostalMandatory = false;
    isPostalAddMandatory = false;
    StringTokenizer st = new StringTokenizer(ds, "@", false);
    while (st.hasMoreTokens()) {
        String s = st.nextToken();
        if (s.startsWith("CO")) {
            //  Country Last
            addComponents((Row) lstCountry.getParent());
        // TODO: Add Online
        // if (m_location.getCountry().isPostcodeLookup()) {
        // addLine(line++, lOnline, fOnline);
        // }
        } else if (s.startsWith("A1")) {
            addComponents((Row) txtAddress1.getParent());
            isAddress1Mandatory = s.endsWith("!");
        } else if (s.startsWith("A2")) {
            addComponents((Row) txtAddress2.getParent());
            isAddress2Mandatory = s.endsWith("!");
        } else if (s.startsWith("A3")) {
            addComponents((Row) txtAddress3.getParent());
            isAddress3Mandatory = s.endsWith("!");
        } else if (s.startsWith("A4")) {
            addComponents((Row) txtAddress4.getParent());
            isAddress4Mandatory = s.endsWith("!");
        } else if (s.startsWith("C")) {
            addComponents((Row) txtCity.getParent());
            isCityMandatory = s.endsWith("!");
        } else if (s.startsWith("P")) {
            addComponents((Row) txtPostal.getParent());
            isPostalMandatory = s.endsWith("!");
        } else if (s.startsWith("A")) {
            addComponents((Row) txtPostalAdd.getParent());
            isPostalAddMandatory = s.endsWith("!");
        } else if (s.startsWith("R") && m_location.getCountry().isHasRegion()) {
            addComponents((Row) lstRegion.getParent());
            isRegionMandatory = s.endsWith("!");
        }
    }
    //      Fill it
    if (m_location.getC_Location_ID() != 0) {
        txtAddress1.setText(m_location.getAddress1());
        txtAddress2.setText(m_location.getAddress2());
        txtAddress3.setText(m_location.getAddress3());
        txtAddress4.setText(m_location.getAddress4());
        txtCity.setText(m_location.getCity());
        txtPostal.setText(m_location.getPostal());
        txtPostalAdd.setText(m_location.getPostal_Add());
        if (m_location.getCountry().isHasRegion()) {
            if (m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName) != null && m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName).trim().length() > 0)
                lblRegion.setValue(m_location.getCountry().get_Translation(MCountry.COLUMNNAME_RegionName));
            else
                lblRegion.setValue(Msg.getMsg(Env.getCtx(), "Region"));
            setRegion();
        }
        setCountry();
    }
}
Also used : StringTokenizer(java.util.StringTokenizer) MCountry(org.compiere.model.MCountry) Row(org.adempiere.webui.component.Row) MRegion(org.compiere.model.MRegion)

Aggregations

Row (org.adempiere.webui.component.Row)79 Rows (org.adempiere.webui.component.Rows)69 Label (org.adempiere.webui.component.Label)29 Grid (org.adempiere.webui.component.Grid)24 Panel (org.adempiere.webui.component.Panel)20 Div (org.zkoss.zul.Div)18 Center (org.zkoss.zul.Center)15 Hbox (org.zkoss.zul.Hbox)15 Space (org.zkoss.zul.Space)14 ConfirmPanel (org.adempiere.webui.component.ConfirmPanel)12 Center (org.zkoss.zkex.zul.Center)11 Separator (org.zkoss.zul.Separator)11 North (org.zkoss.zkex.zul.North)10 Borderlayout (org.zkoss.zul.Borderlayout)9 North (org.zkoss.zul.North)9 South (org.zkoss.zkex.zul.South)8 South (org.zkoss.zul.South)8 Caption (org.zkoss.zul.Caption)6 Listbox (org.adempiere.webui.component.Listbox)5 WSearchEditor (org.adempiere.webui.editor.WSearchEditor)5