I'm trying to build an EditableRootList which contains SwitchableObjects, and I noticed that in the Templates, the SwitchableObject doesn't contain the code necessary to comply with the following DataPortal_Update method of the template's EditableRootList code:
Protected Overrides Sub DataPortal_Update()
RaiseListChangedEvents = False
For Each item As EditableChild In DeletedList
item.DeleteSelf()
Next
DeletedList.Clear()
For Each item As EditableChild In Me
If item.IsNew Then
item.Insert(Me)
Else
item.Update(Me)
End If
Next
RaiseListChangedEvents = True
End Sub
Now I know that Rocky discourages the use of SwitchableObjects, but can anyone provide some insight on what I might need to do to my SwitchableObject to get it to comply with this code?
Rocky, thanks for the quick reply... Makes sense to me, but the code you posted isn't in the switchable object template. Is there an updated version of the templates project available for download?
Copyright (c) Marimer LLC