Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
In the latest update of Episerver CMS modifications of a PropertyList entry in the edit UI are detected, so I can publish my changes there
However when I change a PropertyList entry from code changes are not detected.
Is this a known issue? Am I doing something wrong?
Hi,
I think that you need to ass the whole list, not just the property of the list. So instead of clone.Contacts[0].Age = 150; you need to execute:
clone.Contacts[0].Age = 150; clone.Contacts = clone.Contacts;
I think that mark property as IsModified should also work:
clone.Property["Contacts"].IsModified = true;
Thanks a million Grzegorz!!
clone.Property["Contacts"].IsModified = true;
did the job!
I really like the new PropertyList in EPiServer. There is a great blog post by Per Magne Skuseth on how to use it with simple classes.
I used Per's code as an example but I ended up with some strange behaviour (yeah yeah, it's beta code I know)
In the UI I can add and remove entries to the list and then publish the changes, this works fine. However when I try to modify entries in the list, changes are not detected. (Try changing the age of a person)
Same goes for modifying entries from code.
No change is stored in the database, nothing is published.
Debugging learned me that IsModified on the PropertyList is always false. How do I get my changes detected?
Thanks,
Mark