Author: igorz
Date: 2007-02-19 05:19:11 -0500 (Mon, 19 Feb 2007)
New Revision: 73102
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI/Page.cs
Log:
2007-02-14 Igor Zelmanovich <[EMAIL PROTECTED]>
* Page.cs: for 2.0: refactoring:
prepare infrastructure for Form.SubmitDisabledControls feature
2007-02-19 Igor Zelmanovich <[EMAIL PROTECTED]>
* HtmlInputCheckBox.cs:
* HtmlInputControl.cs:
* HtmlInputHidden.cs:
* HtmlInputRadioButton.cs:
* HtmlInputText.cs:
* HtmlSelect.cs:
* HtmlTextArea.cs:
fixed: Form.SubmitDisabledControls feature:
not all HtmlInputControl need to be reenabled on client.
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2007-02-19 09:40:56 UTC
(rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2007-02-19 10:19:11 UTC
(rev 73102)
@@ -1,3 +1,8 @@
+2007-02-14 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * Page.cs: for 2.0: refactoring:
+ prepare infrastructure for Form.SubmitDisabledControls feature
+
2007-02-18 Eyal Alaluf <[EMAIL PROTECTED]>
* Control.jvm.cs, Control.cs: Move TemplateSourceDirectory to .jvm file.
Modified: trunk/mcs/class/System.Web/System.Web.UI/Page.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Page.cs 2007-02-19 09:40:56 UTC
(rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI/Page.cs 2007-02-19 10:19:11 UTC
(rev 73102)
@@ -76,6 +76,7 @@
private object [] _savedControlState;
private bool _doLoadPreviousPage;
string _focusedControlID;
+ bool _hasEnabledControlArray;
#endif
private bool _viewState = true;
private bool _viewStateMac;
@@ -121,6 +122,7 @@
#if NET_2_0
const string ScrollPositionXID = "__SCROLLPOSITIONX";
const string ScrollPositionYID = "__SCROLLPOSITIONY";
+ const string EnabledControlArrayID = "__enabledControlArray";
#endif
#if NET_2_0
@@ -1808,11 +1810,8 @@
_focusedControlID = Form.DefaultButton;
}
- if (!String.IsNullOrEmpty (_focusedControlID) ||
Form.SubmitDisabledControls) {
-
- ClientScript.RegisterWebFormClientScript ();
-
if (!String.IsNullOrEmpty (_focusedControlID)) {
+ ClientScript.RegisterWebFormClientScript ();
ClientScript.RegisterStartupScript
("HtmlForm-DefaultButton-StartupScript",
String.Format ("<script type=\"text/javascript\">\n" +
"<!--\n" +
@@ -1820,12 +1819,20 @@
"</script>\n", _focusedControlID));
}
- if (Form.SubmitDisabledControls) {
+ if (Form.SubmitDisabledControls &&
_hasEnabledControlArray) {
+ ClientScript.RegisterWebFormClientScript ();
ClientScript.RegisterOnSubmitStatement
("HtmlForm-SubmitDisabledControls-SubmitStatement",
"WebForm_ReEnableControls(this);");
}
- }
}
+
+ internal void RegisterEnabledControl (Control control)
+ {
+ if (Form == null || !Page.Form.SubmitDisabledControls ||
!Page.Form.DetermineRenderUplevel ())
+ return;
+ _hasEnabledControlArray = true;
+ Page.ClientScript.RegisterArrayDeclaration
(EnabledControlArrayID, String.Format ("'{0}'", control.ClientID));
+ }
protected virtual void OnSaveStateComplete (EventArgs e)
{
Modified: trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
2007-02-19 10:19:11 UTC (rev 73102)
@@ -1,3 +1,15 @@
+2007-02-19 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * HtmlInputCheckBox.cs:
+ * HtmlInputControl.cs:
+ * HtmlInputHidden.cs:
+ * HtmlInputRadioButton.cs:
+ * HtmlInputText.cs:
+ * HtmlSelect.cs:
+ * HtmlTextArea.cs:
+ fixed: Form.SubmitDisabledControls feature:
+ not all HtmlInputControl need to be reenabled on client.
+
2007-02-18 Eyal Alaluf <[EMAIL PROTECTED]>
* HtmlForm.cs: Under TARGET_J2EE use Page.RenderResponse instead of
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -108,6 +108,10 @@
if (Page != null) {
Page.RegisterRequiresPostBack (this);
}
+#if NET_2_0
+ if (Page != null && !Disabled)
+ Page.RegisterEnabledControl (this);
+#endif
}
protected virtual void OnServerChange (EventArgs e)
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -92,12 +92,8 @@
}
base.RenderAttributes (writer);
writer.Write (" /");
-
-#if NET_2_0
- if (Page != null && Page.Form != null &&
Page.Form.SubmitDisabledControls && Page.Form.DetermineRenderUplevel() &&
!Disabled)
- Page.ClientScript.RegisterArrayDeclaration
("__enabledControlArray", String.Format ("'{0}'", ClientID));
-#endif
}
}
}
+
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -113,6 +113,10 @@
if (Page != null) {
Page.RegisterRequiresPostBack (this);
}
+#if NET_2_0
+ if (Page != null && !Disabled)
+ Page.RegisterEnabledControl (this);
+#endif
}
protected virtual void OnServerChange (EventArgs e)
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -108,6 +108,10 @@
if (Page != null) {
Page.RegisterRequiresPostBack (this);
}
+#if NET_2_0
+ if (Page != null && !Disabled)
+ Page.RegisterEnabledControl (this);
+#endif
}
protected virtual void OnServerChange (EventArgs e)
Modified: trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -129,6 +129,10 @@
if (Page != null) {
Page.RegisterRequiresPostBack (this);
}
+#if NET_2_0
+ if (Page != null && !Disabled)
+ Page.RegisterEnabledControl (this);
+#endif
}
protected virtual void OnServerChange (EventArgs e)
Modified: trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -595,6 +595,10 @@
if (Page != null) {
Page.RegisterRequiresPostBack (this);
}
+#if NET_2_0
+ if (Page != null && !Disabled)
+ Page.RegisterEnabledControl (this);
+#endif
}
protected virtual void OnServerChange (EventArgs e)
Modified: trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
2007-02-19 09:40:56 UTC (rev 73101)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
2007-02-19 10:19:11 UTC (rev 73102)
@@ -126,6 +126,10 @@
if (Page != null) {
Page.RegisterRequiresPostBack (this);
}
+#if NET_2_0
+ if (Page != null && !Disabled)
+ Page.RegisterEnabledControl (this);
+#endif
}
protected virtual void OnServerChange (EventArgs e)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches