Validation on child list not firing from parent

Validation on child list not firing from parent

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


triplea posted on Sunday, October 26, 2008

Hi

Using CSLA 3.5.1. I the following object tree:

Invoice (Root)
   InvoiceLineList (EditableList)
      InvoiceLine (EditableChild)

InvoiceLine has a property of type bool called IsMainLine.I need to write a simple rule that ensures that one and only one main line exit for each invoice. So I wrote the following:

In Inoivce.AddBusinessRules():
ValidationRules.AddRule<Invoice>(PrimaryLineRequired<Invoice>, InvoiceLinesProperty);

And have implemented PrimaryLineRequired. InvoiceLinesProperty is registered fine so on save the list is dirty. Yet the rule never fires... I expected that when IsMainLine changes (or any property in any InvoiceLine in InvliceLineList) that the above rue would fire.

Any ideas?

jgamba replied on Sunday, October 26, 2008

Please, read

http://forums.lhotka.net/forums/thread/27444.aspx

triplea replied on Sunday, October 26, 2008

Thanks for the link it worked! Apologies for the duplication...

Copyright (c) Marimer LLC