Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26070
Modified Files:
ValidationError.cs ValidationSummary.cs
Log Message:
SPRNET-558 - Enable Data Validation and Model Managment for UserControl
Index: ValidationSummary.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls/ValidationSummary.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ValidationSummary.cs 2 Aug 2007 19:19:42 -0000 1.8
--- ValidationSummary.cs 26 Feb 2008 21:21:26 -0000 1.9
***************
*** 30,33 ****
--- 30,34 ----
/// </summary>
/// <author>Aleksandar Seovic</author>
+ /// <author>Jonathan Allenby</author>
/// <version>$Id$</version>
public class ValidationSummary : Control
***************
*** 96,100 ****
if (Visible)
{
! IList errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource);
Renderer.RenderErrors(Page, writer, errorMessages);
}
--- 97,116 ----
if (Visible)
{
! IList errorMessages;
!
! System.Type t = typeof(Spring.Web.UI.Page);
!
! if (this.TemplateControl != null) t = this.TemplateControl.GetType();
!
! if (t.IsSubclassOf(typeof(Spring.Web.UI.UserControl)))
! {
! Spring.Web.UI.UserControl container = (Spring.Web.UI.UserControl)this.TemplateControl as Spring.Web.UI.UserControl;
! errorMessages = container.ValidationErrors.GetResolvedErrors(this.Provider, container.MessageSource);
! }
! else
! {
! errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource);
! }
!
Renderer.RenderErrors(Page, writer, errorMessages);
}
Index: ValidationError.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls/ValidationError.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ValidationError.cs 2 Aug 2007 19:19:42 -0000 1.8
--- ValidationError.cs 26 Feb 2008 21:21:26 -0000 1.9
***************
*** 29,32 ****
--- 29,33 ----
/// </summary>
/// <author>Aleksandar Seovic</author>
+ /// <author>Jonathan Allenby</author>
/// <version>$Id$</version>
public class ValidationError : Control
***************
*** 95,99 ****
if (Visible)
{
! IList errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource);
Renderer.RenderErrors(Page, writer, errorMessages);
}
--- 96,115 ----
if (Visible)
{
! IList errorMessages;
!
! System.Type t = typeof(Spring.Web.UI.Page);
!
! if (this.TemplateControl != null) t = this.TemplateControl.GetType();
!
! if (t.IsSubclassOf(typeof(Spring.Web.UI.UserControl)))
! {
! Spring.Web.UI.UserControl container = (Spring.Web.UI.UserControl)this.TemplateControl as Spring.Web.UI.UserControl;
! errorMessages = container.ValidationErrors.GetResolvedErrors(this.Provider, container.MessageSource);
! }
! else
! {
! errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource);
! }
!
Renderer.RenderErrors(Page, writer, errorMessages);
}
|