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 ; } }
Adds a new value to the list .