public boolean saveOrUpdateValue(AssociationValue associationValue) {
		if (idByValue.containsKey(associationValue)) {
			updateValue(associationValue);
			setData(getRecords());
			return true;
		} else {
			// Calculate id
			Object idObject = associationValue.getId().getValue();
			String id;
			if (idObject != null) {
				id = idObject.toString();
			} else {
				// fake id
				id = NEW_PREFIX + "." + (newRows++);
			}
			// Feature checks out, add it to the grid:
			ListGridRecord record = new ListGridRecord();
			record.setAttribute(ID_NAME, id);
			updateAttributes(associationValue, record);
			idByValue.put(associationValue, id);
			addData(record);
			return false;
		}
	}
public boolean saveOrUpdateValue ( AssociationValue associationValue ) { if ( idByValue . containsKey ( associationValue ) ) { updateValue ( associationValue ) ; setData ( getRecords ( ) ) ; return true ; } else { Object idObject = associationValue . getId ( ) . getValue ( ) ; String id ; if ( idObject != null ) { id = idObject . toString ( ) ; } else { id = NEW_PREFIX + "." + ( newRows ++ ) ; } ListGridRecord record = new ListGridRecord ( ) ; record . setAttribute ( ID_NAME , id ) ; updateAttributes ( associationValue , record ) ; idByValue . put ( associationValue , id ) ; addData ( record ) ; return false ; } }
Adds a new value to the list.

@param associationValue The value to be added to the list.
@return Returns true in case of update, and false if the value is already in the list or the value is null