Maintaining a List for the UI only on the business object

Maintaining a List for the UI only on the business object

Old forum URL: forums.lhotka.net/forums/t/10694.aspx


thaehn posted on Friday, September 16, 2011

I have a "mover" that shows two lists, one that has been selected and are children of a business object list, an one that has every available option that isn't in the child list (available list).  When a button is clicked to move an item from the available to the selected list, it disappears off the available list; and when another button is clicked to move the item off the selected list, it reappears on the available list.  I have every thing working properly but now when I try to save my business object, I get an error, "Edit level mismatch in AcceptChanges".  Because the selected list is a child of another list, I have a copy of it on the business object which is used to create the items not to show in the available list.  The code looks like this:

public static readonly PropertyInfo<MaintenanceActionPlanList> ProblemActionPlanListProperty = RegisterProperty<MaintenanceActionPlanList>(c => c.ProblemActionPlanList, RelationshipTypes.PrivateField);

 

[

 

NotUndoable]

 

 

 

private MaintenanceActionPlanList _actionPlanList = new MaintenanceActionPlanList();

[

 

Display(Name = "Problem Action Plans")]

 

 

 

public MaintenanceActionPlanList ProblemActionPlanList

{

 

 

 

get { return GetProperty(ProblemActionPlanListProperty, _actionPlanList); }

 

 

 

set { SetProperty(ProblemActionPlanListProperty, ref _actionPlanList, value);

}

 

This list is never persisted to the database, it is only for display purposes, but CSLA is preventing me from saving because of it.  I have set it to [notundoable] and created a private backing field, but it hasn't helped.

Copyright (c) Marimer LLC