Author: igorz
Date: 2006-11-01 04:46:43 -0500 (Wed, 01 Nov 2006)
New Revision: 67210

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewRowTest.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs
Log:
2006-11-01 Igor Zelmanovich <[EMAIL PROTECTED]>

        * FormView.cs: fixed: UpdateItem, DeleteItem.



Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-11-01 06:46:23 UTC (rev 67209)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-11-01 09:46:43 UTC (rev 67210)
@@ -1,3 +1,7 @@
+2006-11-01 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * FormView.cs: fixed: UpdateItem, DeleteItem.
+
 2006-10-31 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * DetailsView.cs: fixed: PageIndex, UpdateItem, InsertItem.

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs    
2006-11-01 06:46:23 UTC (rev 67209)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs    
2006-11-01 09:46:43 UTC (rev 67210)
@@ -839,11 +839,11 @@
                        dataSource.PageSize = 1;
                        dataSource.CurrentPageIndex = PageIndex;
 
-                       if (dataBinding) {
+                       if (dataBinding && CurrentMode != FormViewMode.Insert) {
                                DataSourceView view = GetData ();
                                if (view != null && view.CanPage) {
                                        dataSource.AllowServerPaging = true;
-                                       if (view.CanRetrieveTotalRowCount)
+                                       if 
(SelectArguments.RetrieveTotalRowCount)
                                                dataSource.VirtualCount = 
SelectArguments.TotalRowCount;
                                }
                        }
@@ -1259,7 +1259,10 @@
                        
                        if (currentMode != FormViewMode.Edit) throw new 
HttpException ("Must be in Edit mode");
                        
-                       currentEditOldValues = oldEditValues.Values;
+                       if (oldEditValues == null)
+                               currentEditOldValues = new OrderedDictionary ();
+                       else
+                               currentEditOldValues = oldEditValues.Values;
                        currentEditRowKeys = DataKey.Values;
                        currentEditNewValues = GetRowValues (false);
                        
@@ -1333,8 +1336,8 @@
                        OnItemDeleting (args);
 
                        if (!args.Cancel) {
-                               if (PageIndex == PageCount - 1)
-                                       PageIndex --;
+                               if (PageIndex > 0 && PageIndex == PageCount - 1)
+                                       PageIndex--;
                                        
                                RequireBinding ();
                                        

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-11-01 06:46:23 UTC (rev 67209)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-11-01 09:46:43 UTC (rev 67210)
@@ -1,7 +1,7 @@
-2006-10-30 Igor Zelmanovich <[EMAIL PROTECTED]>
+2006-11-01 Igor Zelmanovich <[EMAIL PROTECTED]>
 
-       * DetailsViewRowTest.cs: removed NotWorking attributes
-       * DetailsViewTest.cs: removed NotWorking attributes
+       * FormViewRowTest.cs: removed NotWorking attributes
+       * FormViewTest.cs: removed NotWorking attributes, fixed tests
                        
 2006-10-30 Igor Zelmanovich <[EMAIL PROTECTED]>
 

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewRowTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewRowTest.cs    
    2006-11-01 06:46:23 UTC (rev 67209)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewRowTest.cs    
    2006-11-01 09:46:43 UTC (rev 67210)
@@ -101,7 +101,6 @@
                private bool dataUpdating = false;
                
                [Test]
-               [Category ("NotWorking")] //NullReferenceException
                public void FormViewRow_BubbleEvent ()
                {
                        FormView fv = new FormView ();
@@ -173,4 +172,4 @@
        }
 }
 
-#endif
\ No newline at end of file
+#endif

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs   
2006-11-01 06:46:23 UTC (rev 67209)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs   
2006-11-01 09:46:43 UTC (rev 67210)
@@ -1427,6 +1427,7 @@
                
 
                [Test]
+               [Category ("NotDotNet")] // becaue Naming container: use 
"FormView1$....." for DotNet
                [Category ("NotWorking")]
                public void FormView_EditPostback ()
                {
@@ -1461,7 +1462,7 @@
                        FormRequest fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$EditButton";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:EditButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";
                        t.Request = fr;
                        pageHTML = t.Run ();
@@ -1492,12 +1493,12 @@
                        fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls.Add ("FormView1$FNameEdit");
-                       fr.Controls.Add ("FormView1$LNameEdit");
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$UpdateButton";
+                       fr.Controls.Add ("FormView1:FNameEdit");
+                       fr.Controls.Add ("FormView1:LNameEdit");
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:UpdateButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";              
        
-                       fr.Controls["FormView1$FNameEdit"].Value = "Merav";
-                       fr.Controls["FormView1$LNameEdit"].Value = "Test";      
                
+                       fr.Controls["FormView1:FNameEdit"].Value = "Merav";
+                       fr.Controls["FormView1:LNameEdit"].Value = "Test";      
                
                        t.Request = fr;
                        pageHTML = t.Run ();
                        newHtml = pageHTML.Substring (pageHTML.IndexOf 
("start") + 5, pageHTML.IndexOf ("end") - pageHTML.IndexOf ("start") - 5);
@@ -1528,7 +1529,7 @@
                        fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$EditButton";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:EditButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";              
        
                        t.Request = fr;
                        pageHTML = t.Run ();
@@ -1540,11 +1541,11 @@
                        fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls.Add ("FormView1$FNameEdit");
-                       fr.Controls.Add ("FormView1$LNameEdit");
-                       fr.Controls["FormView1$FNameEdit"].Value = 
"EditFirstName";
-                       fr.Controls["FormView1$LNameEdit"].Value = 
"EditLastName";
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$CancelUpdateButton";
+                       fr.Controls.Add ("FormView1:FNameEdit");
+                       fr.Controls.Add ("FormView1:LNameEdit");
+                       fr.Controls["FormView1:FNameEdit"].Value = 
"EditFirstName";
+                       fr.Controls["FormView1:LNameEdit"].Value = 
"EditLastName";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:CancelUpdateButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";
                        t.Request = fr;
                        pageHTML = t.Run ();
@@ -1576,7 +1577,7 @@
 
                [Test]
                [Category ("NotWorking")]
-               [Category ("NotDotNet")] //TODO
+               [Category ("NotDotNet")] // becaue Naming container: use 
"FormView1$....." for DotNet
                public void FormView_InsertPostback ()
                {
                        WebTest t = new WebTest 
("FormViewInsertEditDelete.aspx");
@@ -1588,7 +1589,7 @@
                        FormRequest fr = new FormRequest (t.Response, "form1"); 
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");                    
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$NewButton";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:NewButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";              
                                
                        t.Request = fr;
                        pageHTML = t.Run ();
@@ -1618,13 +1619,13 @@
                        fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls.Add ("FormView1$IDInsert");
-                       fr.Controls.Add ("FormView1$FNameInsert");
-                       fr.Controls.Add ("FormView1$LNameInsert");
-                       fr.Controls["FormView1$IDInsert"].Value = "33";
-                       fr.Controls["FormView1$FNameInsert"].Value = 
"InsertFirstName";
-                       fr.Controls["FormView1$LNameInsert"].Value 
="InsertLastName";
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$InsertButton";
+                       fr.Controls.Add ("FormView1:IDInsert");
+                       fr.Controls.Add ("FormView1:FNameInsert");
+                       fr.Controls.Add ("FormView1:LNameInsert");
+                       fr.Controls["FormView1:IDInsert"].Value = "33";
+                       fr.Controls["FormView1:FNameInsert"].Value = 
"InsertFirstName";
+                       fr.Controls["FormView1:LNameInsert"].Value 
="InsertLastName";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:InsertButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";
                        t.Request = fr;
                        pageHTML = t.Run ();                    
@@ -1649,8 +1650,7 @@
                }               
 
                [Test]
-               [Category ("NotWorking")]
-               [Category ("NotDotNet")] //TODO
+               [Category ("NotDotNet")] // becaue Naming container: use 
"FormView1$DeleteButton" for DotNet
                public void FormView_DeleteAndEmptyTemplatePostback ()
                {
                        WebTest t = new WebTest 
("FormViewInsertEditDelete.aspx");
@@ -1664,7 +1664,7 @@
                        FormRequest fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$DeleteButton";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:DeleteButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";
                        t.Request = fr;
                        pageHTML = t.Run ();                    
@@ -1679,7 +1679,7 @@
                        fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$DeleteButton";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:DeleteButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";
                        t.Request = fr;
                        pageHTML = t.Run ();
@@ -1693,7 +1693,7 @@
                        fr = new FormRequest (t.Response, "form1");
                        fr.Controls.Add ("__EVENTTARGET");
                        fr.Controls.Add ("__EVENTARGUMENT");
-                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1$DeleteButton";
+                       fr.Controls["__EVENTTARGET"].Value = 
"FormView1:DeleteButton";
                        fr.Controls["__EVENTARGUMENT"].Value = "";
                        t.Request = fr;
                        pageHTML = t.Run ();                    

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to