Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv877/src/Spring/Spring.Web/Web/UI/Controls
Modified Files:
ValidationError.cs ValidationSummary.cs
Added Files:
AbstractValidationControl.cs
Log Message:
SPRNET-558, SPRNET-559
introduced new IValidationContainer interface
Index: ValidationSummary.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls/ValidationSummary.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ValidationSummary.cs 26 Feb 2008 22:33:37 -0000 1.10
--- ValidationSummary.cs 19 Mar 2008 12:07:14 -0000 1.11
***************
*** 19,26 ****
#endregion
! using System.Collections;
! using System.Web.UI;
using Spring.Web.UI.Validation;
namespace Spring.Web.UI.Controls
{
--- 19,28 ----
#endregion
! #region Imports
!
using Spring.Web.UI.Validation;
+ #endregion
+
namespace Spring.Web.UI.Controls
{
***************
*** 32,121 ****
/// <author>Jonathan Allenby</author>
/// <version>$Id$</version>
! public class ValidationSummary : Control
{
- private string provider;
- private IValidationErrorsRenderer renderer;
-
/// <summary>
! /// Gets or sets the provider.
! /// </summary>
! /// <value>The provider.</value>
! public string Provider
! {
! get
! {
! if (this.provider == null)
! {
! return this.ID;
! }
! return this.provider;
! }
! set { this.provider = value; }
! }
!
! /// <summary>
! /// Gets or sets the validation errors renderer to use.
! /// </summary>
! /// <remarks>
! /// If not explicitly specified, defaults to <see cref="DivValidationErrorsRenderer"/>.
! /// </remarks>
! /// <value>The validation errors renderer to use.</value>
! public IValidationErrorsRenderer Renderer
! {
! get
! {
! if (this.renderer == null)
! {
! this.renderer = new DivValidationErrorsRenderer();
! }
! return this.renderer;
! }
! set { this.renderer = value; }
! }
!
! /// <summary>
! /// Gets a reference to the <see cref="T:Spring.Web.UI.Page"/> instance that contains the
! /// server control.
! /// </summary>
! /// <value></value>
! new private Page Page
! {
! get { return base.Page as Page; }
! }
!
! /// <summary>
! /// Renders control.
/// </summary>
! /// <param name="writer"></param>
! protected override void Render(HtmlTextWriter writer)
{
! #if ! NET_2_0
! bool DesignMode = this.Context == null;
! #endif
! if (!DesignMode)
! {
! if (Visible)
! {
! IList errorMessages;
! #if NET_1_1
! errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource);
! #else
! 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);
! }
! #endif
! Renderer.RenderErrors(Page, writer, errorMessages);
! }
! }
}
}
--- 34,46 ----
/// <author>Jonathan Allenby</author>
/// <version>$Id$</version>
! public class ValidationSummary : AbstractValidationControl
{
/// <summary>
! /// Create the default <see cref="DivValidationErrorsRenderer"/>
! /// for this ValidationControl if none is configured.
/// </summary>
! protected override IValidationErrorsRenderer CreateValidationErrorsRenderer()
{
! return new DivValidationErrorsRenderer();
}
}
Index: ValidationError.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls/ValidationError.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ValidationError.cs 26 Feb 2008 22:33:37 -0000 1.10
--- ValidationError.cs 19 Mar 2008 12:07:14 -0000 1.11
***************
*** 19,26 ****
#endregion
! using System.Collections;
! using System.Web.UI;
using Spring.Web.UI.Validation;
namespace Spring.Web.UI.Controls
{
--- 19,28 ----
#endregion
! #region Imports
!
using Spring.Web.UI.Validation;
+ #endregion
+
namespace Spring.Web.UI.Controls
{
***************
*** 31,121 ****
/// <author>Jonathan Allenby</author>
/// <version>$Id$</version>
! public class ValidationError : Control
{
- private string provider;
- private IValidationErrorsRenderer renderer;
-
- /// <summary>
- /// Gets or sets the provider.
- /// </summary>
- /// <value>The provider.</value>
- public string Provider
- {
- get
- {
- if (this.provider == null)
- {
- return this.ID;
- }
- return this.provider;
- }
- set { this.provider = value; }
- }
-
- /// <summary>
- /// Gets or sets the validation errors renderer to use.
- /// </summary>
- /// <remarks>
- /// If not explicitly specified, defaults to <see cref="SpanValidationErrorsRenderer"/>.
- /// </remarks>
- /// <value>The validation errors renderer to use.</value>
- public IValidationErrorsRenderer Renderer
- {
- get
- {
- if (this.renderer == null)
- {
- this.renderer = new SpanValidationErrorsRenderer();
- }
- return this.renderer;
- }
- set { this.renderer = value; }
- }
-
- /// <summary>
- /// Gets a reference to the <see cref="T:Spring.Web.UI.Page"/> instance that contains the
- /// server control.
- /// </summary>
- /// <value></value>
- new private Page Page
- {
- get { return base.Page as Page; }
- }
-
/// <summary>
! /// Renders control.
/// </summary>
! /// <param name="writer"></param>
! protected override void Render(HtmlTextWriter writer)
{
! #if ! NET_2_0
! bool DesignMode = this.Context == null;
! #endif
! if (!DesignMode)
! {
! if (Visible)
! {
! IList errorMessages;
!
! System.Type t = typeof(Spring.Web.UI.Page);
! #if NET_1_1
! errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource);
! #else
! 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);
! }
! #endif
!
! Renderer.RenderErrors(Page, writer, errorMessages);
! }
! }
}
}
--- 33,45 ----
/// <author>Jonathan Allenby</author>
/// <version>$Id$</version>
! public class ValidationError : AbstractValidationControl
{
/// <summary>
! /// Create the default <see cref="SpanValidationErrorsRenderer"/>
! /// for this ValidationControl if none is configured.
/// </summary>
! protected override IValidationErrorsRenderer CreateValidationErrorsRenderer()
{
! return new SpanValidationErrorsRenderer();
}
}
--- NEW FILE: AbstractValidationControl.cs ---
(This appears to be a binary file; contents omitted.)
|