else {
String editRelationshipConfigurationName = (String)valueForBinding("editRelationshipConfigurationName");
if(editRelationshipConfigurationName != null && editRelationshipConfigurationName.length() > 0) {
nextPage = D2W.factory().pageForConfigurationNamed(editRelationshipConfigurationName, session());
if(nextPage instanceof EditRelationshipPageInterface) {
EditRelationshipPageInterface epi = (EditRelationshipPageInterface)nextPage;
epi.setMasterObjectAndRelationshipKey(object(), key());
epi.setNextPage(context().page());
} else if(nextPage instanceof EditPageInterface) {
Object value = d2wContext().valueForKey("useNestedEditingContext");
boolean createNestedContext = ERXValueUtilities.booleanValue(value);
EOEnterpriseObject object = ERXEOControlUtilities.editableInstanceOfObject(object(), createNestedContext);
EOEditingContext ec = object.editingContext();
ec.lock();
try {
EOEnterpriseObject eo = ERXEOControlUtilities.createAndAddObjectToRelationship(ec, object, key(), (String)valueForBinding("destinationEntityName"), null);
EditPageInterface epi = (EditPageInterface)nextPage;
epi.setObject(eo);
epi.setNextPage(context().page());
} finally {
ec.unlock();
}
}
} else {