Search in sources :

Example 51 with ListItem

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

the class WBOMDrop method cmd_save.

//	isSelected
/**************************************************************************
	 * 	Save Selection
	 * 	@return true if saved
	 */
private boolean cmd_save() {
    ListItem listitem = orderField.getSelectedItem();
    KeyNamePair pp = null;
    if (listitem != null)
        pp = listitem.toKeyNamePair();
    if (pp != null && pp.getKey() > 0)
        return cmd_saveOrder(pp.getKey());
    listitem = invoiceField.getSelectedItem();
    pp = null;
    if (listitem != null)
        pp = listitem.toKeyNamePair();
    if (pp != null && pp.getKey() > 0)
        return cmd_saveInvoice(pp.getKey());
    listitem = projectField.getSelectedItem();
    pp = null;
    if (listitem != null)
        pp = listitem.toKeyNamePair();
    if (pp != null && pp.getKey() > 0)
        return cmd_saveProject(pp.getKey());
    log.log(Level.SEVERE, "Nothing selected");
    return false;
}
Also used : ListItem(org.adempiere.webui.component.ListItem) KeyNamePair(org.compiere.util.KeyNamePair)

Example 52 with ListItem

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

the class WAttachment method getFileName.

/**
	 * 	Get File Name with index
	 *	@param index index
	 *	@return file name or null
	 */
private String getFileName(int index) {
    String fileName = null;
    if (cbContent.getItemCount() > index) {
        ListItem listitem = cbContent.getItemAtIndex(index);
        fileName = (String) listitem.getValue();
    }
    return fileName;
}
Also used : ListItem(org.adempiere.webui.component.ListItem)

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