What I see if we need this nice view render we need to make HtmlHelper & FormHelper aware of ModelState, ModelStateDictionary etc. Just wonder if anyone find this feature interesting because I am willing to implement it for MonoRail.
On Apr 1, 3:25 am, Alex Henderson <[email protected]> wrote: > Also as Rafael said - it tends to be a lot easier to mutate the model state > in filters or code before the view gets a hold of it when compared to > monorail... i.e. I dont think in monorail you can easily manipulate the > ErrorSummary instances to remove an error (but you can replace the error > sumary entirely, so it's not impossible)... but with ModelState it's a > little easier. > > Technically that's more of an issue with Castle.Components.Validator then > monorail though - and there are generally ways to work around this in > monorail because the validator component is being used... > > Thoughts? > > On Wed, Apr 1, 2009 at 9:15 AM, Alex Henderson <[email protected]>wrote: > > > ModelState really just allows you to ask questions like "is everything > > valid" and to iterate across the state of "action" as a whole looking for > > errors which may have occured - basically it's a big dictionary... so in > > your controller you can check to see if everythings ok.. > > > if (ModelState.IsValid) { .... } > > > Or you could add an error for a certain parameter... > > > ModelState.AddModelError("customer.Address.Street", "Street is a required > > value"); > > > ModelState is a property of the controller, of type "ModelStateDictionary" > > ... and it really is just a dictionary of strings to instances of > > "ModelState"... ModelState stores a list of exceptions/errors > > (ModelErrorCollection) and the Value (ValueProviderResult). > > > ValueProviderResult provides access to the raw value returned from the > > binder, as well as what culture was used to create the raw value. > > > It's not really all that different to monorail - they just invert it so > > that state is associated with the key, rather then having seperate > > validation summaries per object - you could probably a tailor a wrapper over > > the top of monorails current implementation to emulate the model state > > behavior to a degree. > > > I've only done one ASP.Net MVC project so far as well, but I'm not sure > > they had an equivalent to monorails simple errors collection available for > > managing errors not associated with the current form that you would like to > > display in a validation summary.. but I could be wrong, I never needed that > > feature at the time. > > >http://msdn.microsoft.com/en-us/library/system.web.mvc.modelstatedict... > > >http://msdn.microsoft.com/en-us/library/system.web.mvc.modelstate_mem... > > >http://msdn.microsoft.com/en-us/library/system.web.mvc.modelerrorcoll... > > >http://msdn.microsoft.com/en-us/library/system.web.mvc.modelerror_mem... > > >http://msdn.microsoft.com/en-us/library/system.web.mvc.valueproviderr... > > > Cheers, > > > - Alex > > > On Wed, Apr 1, 2009 at 1:23 AM, Rafael Teixeira <[email protected]> wrote: > > >> No, it is the pattern I've been using for decades of having the various > >> validators collect together their complaints about the input, so that they > >> can be rendered at once in the view. > >> Monorail also can do that, but the good thing is that the ModelState can > >> be further manipulated in a easy way before being handed out to the view > >> engine, which I think is just a bit more difficult in Monorail, but maybe > >> it's just my ignorance on the subject. > > >> Cheers, > > >> On Tue, Mar 31, 2009 at 8:18 AM, Markus Zywitza <[email protected] > >> > wrote: > > >>> Is this ViewState for MVC? > > >>> 2009/3/30 c.sokun <[email protected]> > > >>>> Have anyone look into ASP.NET <http://asp.net/> MVC ModelState feature? > > >> -- > >> Rafael "Monoman" Teixeira > >> --------------------------------------- > >> "I myself am made entirely of flaws, stitched together with good > >> intentions." > >> Augusten Burroughs > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en -~----------~----~----~----~------~----~------~--~---
