public WOComponent removeFromToManyRelationshipAction() {
if(((ERXSession)session()).javaScriptEnabled())
updateEOsOrdering();
if (browserSelections != null) {
for (Enumeration e = browserSelections.objectEnumerator(); e.hasMoreElements();) {
EOEnterpriseObject object=(EOEnterpriseObject)e.nextElement();
EOEnterpriseObject _localEoToRremoveFromRelationship =
(EOEnterpriseObject)object.valueForKey(destinationRelationship().name());
object.removeObjectFromBothSidesOfRelationshipWithKey(_localEoToRremoveFromRelationship,
destinationRelationship().name());
object().removeObjectFromBothSidesOfRelationshipWithKey(object,
relationshipKey());
if(((object instanceof ERXGuardedObjectInterface) && ((ERXGuardedObjectInterface)object).canDelete())
|| !(object instanceof ERXGuardedObjectInterface)) {
editingContext().deleteObject(object);
}
}
relationshipDisplayGroup.fetch(); // updateDisplayedObjects is not doing the trick
if (isSortedRelationship()) {
//Now need to reindex the joins if the relationship is sorted
int i = 0;
for(Enumeration e = relationshipDisplayGroup.displayedObjects().objectEnumerator();
e.hasMoreElements();){
EOEnterpriseObject object = (EOEnterpriseObject)e.nextElement();
object.takeValueForKey(ERXConstant.integerForInt(i), indexKey());
i++;
}
}
}
return null;