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;
}
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);
}
}
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;
}
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);
}
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);
}
Aggregations