EOEnterpriseObject joinEO=ERXUtilities.createEO(entity().name(), editingContext());
EOEnterpriseObject joinEO=ERXEOControlUtilities.createAndInsertObject(editingContext(), entity().name());
    public WOComponent selectAction() {        EOEnterpriseObject _localEoToAddToRelationship = _eoToAddToRelationship != null ?        EOUtilities.localInstanceOfObject(editingContext(),_eoToAddToRelationship) : null;        if (_localEoToAddToRelationship != null) {            // we create a join EO            EOEnterpriseObject joinEO=ERXUtilities.createEO(entity().name(),                                                             editingContext());            NSArray sortedObjects=relationshipDisplayGroup.displayedObjects();            if(isSortedRelationship()){                Number lastIndex = null;                if (sortedObjects!=null && sortedObjects.count()>0) {                    EOEnterpriseObject lastObject=(EOEnterpriseObject)relationshipDisplayGroup.displayedObjects().lastObject();                    lastIndex=(Number)lastObject.valueForKey(indexKey());                }                int newIndex = lastIndex!=null ? lastIndex.intValue()+1 : 0;                joinEO.takeValueForKey(ERXConstant.integerForInt(newIndex),indexKey());                            }            joinEO.addObjectToBothSidesOfRelationshipWithKey(_localEoToAddToRelationship,                                                             destinationRelationship().name());            object().addObjectToBothSidesOfRelationshipWithKey(joinEO, relationshipKey());            dataSource().insertObject(joinEO);            relationshipDisplayGroup.fetch();        } else {            // no object was selected            _state = QUERY;        }        return null;    }