Search in sources :

Example 11 with ListItem

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

the class WRecordAccessDialog method cmd_save.

/**
	 * 	Save Command
	 *	@return true if saved
	 */
private boolean cmd_save() {
    ListItem pp = roleField.getSelectedItem();
    if (pp == null)
        return false;
    int AD_Role_ID = ((Integer) pp.getValue()).intValue();
    //
    boolean isActive = cbActive.isSelected();
    boolean isExclude = cbExclude.isSelected();
    boolean isReadOnly = cbReadOnly.isSelected();
    boolean isDependentEntities = cbDependent.isSelected();
    //
    if (m_currentData == null) {
        m_currentData = new MRecordAccess(Env.getCtx(), AD_Role_ID, m_AD_Table_ID, m_Record_ID, null);
        m_recordAccesss.add(m_currentData);
        m_currentRow = m_recordAccesss.size() - 1;
    }
    m_currentData.setIsActive(isActive);
    m_currentData.setIsExclude(isExclude);
    m_currentData.setIsReadOnly(isReadOnly);
    m_currentData.setIsDependentEntities(isDependentEntities);
    boolean success = m_currentData.save();
    //
    log.fine("Success=" + success);
    return success;
}
Also used : ListItem(org.adempiere.webui.component.ListItem) MRecordAccess(org.compiere.model.MRecordAccess)

Example 12 with ListItem

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

the class WLocationDialog method setRegion.

private void setRegion() {
    if (m_location.getRegion() != null) {
        List<?> listState = lstRegion.getChildren();
        Iterator<?> iter = listState.iterator();
        while (iter.hasNext()) {
            ListItem listitem = (ListItem) iter.next();
            if (m_location.getRegion().equals(listitem.getValue())) {
                lstRegion.setSelectedItem(listitem);
            }
        }
    } else {
        lstRegion.setSelectedItem(null);
    }
}
Also used : ListItem(org.adempiere.webui.component.ListItem)

Example 13 with ListItem

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

the class WLocatorDialog method getValue.

// actionOK
/**
	 *	Get Selected value
	 *  @return value as Integer
	 */
public Integer getValue() {
    ListItem listitem = lstLocator.getSelectedItem();
    MLocator l = (MLocator) listitem.getValue();
    if (l != null && l.getM_Locator_ID() != 0)
        return new Integer(l.getM_Locator_ID());
    return null;
}
Also used : MLocator(org.compiere.model.MLocator) ListItem(org.adempiere.webui.component.ListItem)

Example 14 with ListItem

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

the class WLocatorDialog method actionOK.

// createValue
/**
	 * 	OK - check for changes (save them) & Exit
	 */
private void actionOK() {
    if (chkCreateNew.isChecked()) {
        //	Get Warehouse Info
        ListItem listitem = lstWarehouse.getSelectedItem();
        KeyNamePair pp = (KeyNamePair) listitem.getValue();
        if (pp != null)
            getWarehouseInfo(pp.getKey());
        //	Check mandatory values
        String mandatoryFields = "";
        if (m_M_Warehouse_ID == 0)
            mandatoryFields += lblWarehouse.getValue() + " - ";
        if (txtKey.getText().length() == 0)
            mandatoryFields += lblKey.getValue() + " - ";
        if (txtAisleX.getText().length() == 0)
            mandatoryFields += lblAisleX.getValue() + " - ";
        if (txtBinY.getText().length() == 0)
            mandatoryFields += lblBinY.getValue() + " - ";
        if (txtLevelZ.getText().length() == 0)
            mandatoryFields += lblLevelZ.getValue() + " - ";
        if (mandatoryFields.length() != 0) {
            FDialog.error(m_WindowNo, this, "FillMandatory", mandatoryFields.substring(0, mandatoryFields.length() - 3));
            return;
        }
        MLocator loc = MLocator.get(Env.getCtx(), m_M_Warehouse_ID, txtKey.getText(), txtAisleX.getText(), txtBinY.getText(), txtLevelZ.getText());
        m_M_Locator_ID = loc.getM_Locator_ID();
        listitem = new ListItem();
        listitem.setValue(loc);
        lstLocator.appendItem(loc.get_TableName(), loc);
        lstLocator.setSelectedIndex(lstLocator.getItemCount() - 1);
    }
    // createNew
    log.config("M_Locator_ID=" + m_M_Locator_ID);
}
Also used : MLocator(org.compiere.model.MLocator) ListItem(org.adempiere.webui.component.ListItem) KeyNamePair(org.compiere.util.KeyNamePair)

Example 15 with ListItem

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

the class ZkReportViewer method cmd_export.

//	cmd_archive
/**
	 * 	Export
	 */
private void cmd_export() {
    log.config("");
    if (!m_isCanExport) {
        FDialog.error(m_WindowNo, this, "AccessCannotExport", getTitle());
        return;
    }
    if (winExportFile == null) {
        winExportFile = new Window();
        winExportFile.setTitle(Msg.getMsg(Env.getCtx(), "Export") + ": " + getTitle());
        winExportFile.setWidth("450px");
        winExportFile.setClosable(true);
        winExportFile.setBorder("normal");
        winExportFile.setStyle("position:absolute");
        cboType.setMold("select");
        cboType.getItems().clear();
        cboType.appendItem("ps" + " - " + Msg.getMsg(Env.getCtx(), "FilePS"), "ps");
        cboType.appendItem("xml" + " - " + Msg.getMsg(Env.getCtx(), "FileXML"), "xml");
        ListItem li = cboType.appendItem("pdf" + " - " + Msg.getMsg(Env.getCtx(), "FilePDF"), "pdf");
        cboType.appendItem("html" + " - " + Msg.getMsg(Env.getCtx(), "FileHTML"), "html");
        cboType.appendItem("txt" + " - " + Msg.getMsg(Env.getCtx(), "FileTXT"), "txt");
        cboType.appendItem("ssv" + " - " + Msg.getMsg(Env.getCtx(), "FileSSV"), "ssv");
        cboType.appendItem("csv" + " - " + Msg.getMsg(Env.getCtx(), "FileCSV"), "csv");
        cboType.appendItem("xls" + " - " + Msg.getMsg(Env.getCtx(), "FileXLS"), "xls");
        cboType.setSelectedItem(li);
        Hbox hb = new Hbox();
        Div div = new Div();
        div.setAlign("right");
        div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType")));
        hb.appendChild(div);
        hb.appendChild(cboType);
        cboType.setWidth("100%");
        Vbox vb = new Vbox();
        vb.setWidth("390px");
        winExportFile.appendChild(vb);
        vb.appendChild(hb);
        vb.appendChild(confirmPanel);
        confirmPanel.addActionListener(this);
    }
    AEnv.showCenterScreen(winExportFile);
}
Also used : Window(org.adempiere.webui.component.Window) Div(org.zkoss.zul.Div) Hbox(org.zkoss.zul.Hbox) Label(org.adempiere.webui.component.Label) ListItem(org.adempiere.webui.component.ListItem) Vbox(org.zkoss.zul.Vbox)

Aggregations

ListItem (org.adempiere.webui.component.ListItem)52 KeyNamePair (org.compiere.util.KeyNamePair)22 Timestamp (java.sql.Timestamp)8 Listbox (org.adempiere.webui.component.Listbox)8 SQLException (java.sql.SQLException)7 BigDecimal (java.math.BigDecimal)6 Label (org.adempiere.webui.component.Label)5 ResultSet (java.sql.ResultSet)4 Date (java.util.Date)4 MLocator (org.compiere.model.MLocator)4 ValueNamePair (org.compiere.util.ValueNamePair)4 Charset (java.nio.charset.Charset)3 PreparedStatement (java.sql.PreparedStatement)3 Calendar (java.util.Calendar)3 GregorianCalendar (java.util.GregorianCalendar)3 NumberBox (org.adempiere.webui.component.NumberBox)3 Row (org.adempiere.webui.component.Row)3 Textbox (org.adempiere.webui.component.Textbox)3 MAttributeValue (org.compiere.model.MAttributeValue)3 BufferedImage (java.awt.image.BufferedImage)2