Author: igorz
Date: 2006-09-18 10:19:21 -0400 (Mon, 18 Sep 2006)
New Revision: 65579
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
Log:
* ListControl.cs:
VewState saving and restoring rolled back to 1.1 implementation
(fixed corresponding test), corrected public interface (there are no
overriden methods SaveControlState, LoadControlState and OnInit),
implemented CausesValidation and ValidationGroup properties.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-09-18 13:50:56 UTC (rev 65578)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-09-18 14:19:21 UTC (rev 65579)
@@ -1,5 +1,13 @@
2006-09-18 Igor Zelmanovich <[EMAIL PROTECTED]>
+ * ListControl.cs:
+ VewState saving and restoring rolled back to 1.1 implementation
+ (fixed corresponding test), corrected public interface (there are no
+ overriden methods SaveControlState, LoadControlState and OnInit),
+ implemented CausesValidation and ValidationGroup properties.
+
+2006-09-18 Igor Zelmanovich <[EMAIL PROTECTED]>
+
* TextBox.cs:
make rendering of the onclick attribute to consider ValidationGroup
property
Page.Validate() is called when CausesValidation=true
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
2006-09-18 13:50:56 UTC (rev 65578)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
2006-09-18 14:19:21 UTC (rev 65579)
@@ -321,30 +321,6 @@
items [i].Selected = false;
}
-#if NET_2_0
- protected internal override void LoadControlState (object
savedState)
- {
- object first = null;
- ArrayList indices = null;
- Pair pair = savedState as Pair;
-
- if (pair != null) {
- first = pair.First;
- indices = pair.Second as ArrayList;
- }
-
- base.LoadControlState (first);
-
- if (indices != null) {
- int count = Items.Count;
- foreach (int index in indices) {
- if (index >= 0 && index < count)
- Items [index].Selected = true;
- }
- }
- }
-#endif
-
protected override void OnDataBinding (EventArgs e)
{
base.OnDataBinding (e);
@@ -372,14 +348,6 @@
}
#if NET_2_0
- protected internal override void OnInit (EventArgs e)
- {
- Page.RegisterRequiresControlState (this);
- base.OnInit (e);
- }
-#endif
-
-#if NET_2_0
protected internal
#else
protected
@@ -453,18 +421,6 @@
base.RenderContents (w);
}
- protected internal override object SaveControlState ()
- {
- object first;
- ArrayList second;
-
- first = base.SaveControlState ();
- second = GetSelectedIndicesInternal ();
- if (second == null)
- second = new ArrayList();
-
- return new Pair (first, second);
- }
#endif
internal ArrayList GetSelectedIndicesInternal ()
@@ -492,46 +448,26 @@
if (manager != null)
second = manager.SaveViewState ();
-#if !NET_2_0
ArrayList selected = GetSelectedIndicesInternal ();
-#endif
- if (first == null && second == null
-#if !NET_2_0
- && selected == null
-#endif
- )
+ if (first == null && second == null && selected == null)
return null;
-#if NET_2_0
- return new Pair (first, second);
-#else
return new Triplet (first, second, selected);
-#endif
}
protected override void LoadViewState (object savedState)
{
object first = null;
object second = null;
-#if !NET_2_0
ArrayList indices = null;
-#endif
-#if NET_2_0
- Pair pair = savedState as Pair;
- if (pair != null) {
- first = pair.First;
- second = pair.Second;
- }
-#else
Triplet triplet = savedState as Triplet;
if (triplet != null) {
first = triplet.First;
second = triplet.Second;
indices = triplet.Third as ArrayList;
}
-#endif
base.LoadViewState (first);
@@ -540,12 +476,10 @@
manager.LoadViewState (second);
}
-#if !NET_2_0
if (indices != null) {
foreach (int index in indices)
Items [index].Selected = true;
}
-#endif
}
#if NET_2_0
@@ -596,31 +530,30 @@
}
- [MonoTODO]
[Themeable (false)]
[DefaultValue (false)]
[WebSysDescription ("")]
[WebCategory ("Behavior")]
- public virtual bool CausesValidation {
+ public virtual bool CausesValidation {
get {
- throw new NotImplementedException ();
+ return ViewState.GetBool ("CausesValidation",
false);
}
+
set {
- throw new NotImplementedException ();
+ ViewState ["CausesValidation"] = value;
}
}
- [MonoTODO]
[Themeable (false)]
[DefaultValue ("")]
[WebSysDescription ("")]
[WebCategoryAttribute ("Behavior")]
public virtual string ValidationGroup {
get {
- throw new NotImplementedException ();
+ return ViewState.GetString ("ValidationGroup",
"");
}
set {
- throw new NotImplementedException ();
+ ViewState ["ValidationGroup"] = value;
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches