You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/06/24 22:05:34 UTC

svn commit: r201673 - in /struts/sandbox/trunk/overdrive/PhoneBook/Web: Forms/Directory.aspx Forms/Directory.aspx.cs Forms/Directory2.aspx default.htm

Author: husted
Date: Fri Jun 24 13:05:32 2005
New Revision: 201673

URL: http://svn.apache.org/viewcvs?rev=201673&view=rev
Log:
OVR-5
* Remove development cruft from Directory.aspx, and retain as a simple display-only example.
* Directory2.aspx is now the default page that would go into production.

Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/default.htm

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx?rev=201673&r1=201672&r2=201673&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx Fri Jun 24 13:05:32 2005
@@ -48,11 +48,9 @@
 			
 			<!-- LIST -->			
 			<asp:Panel ID="pnlList" Runat="server">
-            	<asp:DataGrid id="repList" Runat="server" 
-					PagerStyle-Mode="NumericPages" AllowPaging="true" PageSize="10" AutoGenerateColumns=False>
+            	<asp:DataGrid id="repList" Runat="server" AutoGenerateColumns=False>
 					<HeaderStyle CssClass="HeaderStyle" BackColor="#CCCC99"></HeaderStyle>
 					<AlternatingItemStyle CssClass="AlternatingItemStyle" BackColor="#CCCC99"></AlternatingItemStyle>
-					<EditItemStyle CssClass="EditItemStyle"></EditItemStyle>
 					<Columns>
 						<asp:BoundColumn DataField="last_name" HeaderText="Last Name"></asp:BoundColumn>
 						<asp:BoundColumn DataField="first_name" HeaderText="First Name"></asp:BoundColumn>
@@ -62,7 +60,6 @@
 						<asp:BoundColumn DataField="hours" HeaderText="Hours"></asp:BoundColumn>
 					</Columns>
             	</asp:DataGrid>
-        		<p><asp:Button ID="cmdAdd" Runat="server"></asp:Button></p>
 			</asp:Panel>
 
 		</form>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs?rev=201673&r1=201672&r2=201673&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs Fri Jun 24 13:05:32 2005
@@ -7,14 +7,14 @@
 namespace PhoneBook.Web.Forms
 {
 	/// <summary>
-	///  Maintain a list of employees with their telephone extension [OVR-5]. 
+	///  Display a list of employees with their telephone extension [OVR-5]. 
 	/// </summary>
 	/// 
 	public class Directory : Page
 	{
+
 		#region Messages
 
-		private const string msg_ADD_CMD = "ADD NEW";
 		private const string msg_LIST_ALL_CMD = "SHOW ALL";
 
 		#endregion
@@ -42,7 +42,7 @@
 
 		private IViewHelper _FindHelper;
 		/// <summary>
-		/// Obtain dynamic data for the default view.
+		/// Display the filter lists.
 		/// </summary>
 		///
 		public virtual IViewHelper FindHelper
@@ -51,6 +51,10 @@
 			set { _FindHelper = value; }
 		}
 
+		/// <summary>
+		/// Apply filter and display matching entries.
+		/// </summary>
+		///
 		private IViewHelper _ListHelper;
 		public virtual IViewHelper ListHelper
 		{
@@ -69,11 +73,8 @@
 		protected DropDownList user_name_list;
 		protected DropDownList hired_list;
 		protected DropDownList hours_list;
-		// TODO: protected DropDownList editor_list;
 		protected Button cmdListAll;
 
-		// pageload events - These methods populate controls to display
-
 		private DropDownList[] FilterList ()
 		{
 			DropDownList[] lists = {last_name_list, first_name_list, extension_list, user_name_list, hired_list, hours_list};
@@ -123,8 +124,6 @@
 				Page_Error = h;
 		}
 
-		// postback events - These events respond to user input (to controls displayed by pageload methods)
-
 		private void ListAll_Click (object sender, EventArgs e)
 		{
 			Filter_Reset (null);
@@ -137,15 +136,6 @@
 
 		protected Panel pnlList;
 		protected DataGrid repList;
-		protected Button cmdAdd;
-
-		// pageload events
-
-		private void List_Init ()
-		{
-			this.cmdAdd.Text = msg_ADD_CMD;
-			this.cmdAdd.Visible = false; // TODO: True if user is editor
-		}
 
 		private void List_Load (IViewHelper helper)
 		{
@@ -160,29 +150,6 @@
 			}
 		}
 
-		// postback events 
-
-		protected void List_ItemCommand (object source, DataGridCommandEventArgs e)
-		{
-			bool okay = false;
-			switch (e.CommandName)
-			{
-				case "Page":
-					// Handled by List_PageIndexChanged
-					break;
-				default:
-					throw new NotImplementedException ();
-			}
-
-			if (okay) pnlList.Visible = false;
-		}
-
-		protected void List_PageIndexChanged (object sender, DataGridPageChangedEventArgs e)
-		{
-			repList.CurrentPageIndex = e.NewPageIndex;
-			repList.DataBind ();
-		}
-
 		#endregion
 
 		#region Page Events
@@ -191,7 +158,6 @@
 		{
 			pnlError.Visible = false;
 			Find_Init ();
-			List_Init ();
 		}
 
 		protected void Page_Load (object sender, EventArgs e)

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx?rev=201673&r1=201672&r2=201673&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx Fri Jun 24 13:05:32 2005
@@ -49,7 +49,7 @@
 			<!-- LIST -->			
 			<asp:Panel ID="pnlList" Runat="server">
             	<asp:DataGrid id="repList" Runat="server" 
-					PagerStyle-Mode="NumericPages" AllowPaging="true" PageSize="10" >
+					PagerStyle-Mode="NumericPages" AllowPaging="true" PageSize="2" >
 					<HeaderStyle CssClass="HeaderStyle" BackColor="#CCCC99"></HeaderStyle>
 					<AlternatingItemStyle CssClass="AlternatingItemStyle" BackColor="#CCCC99"></AlternatingItemStyle>
 					<EditItemStyle CssClass="EditItemStyle"></EditItemStyle>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/default.htm
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/default.htm?rev=201673&r1=201672&r2=201673&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/default.htm (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/default.htm Fri Jun 24 13:05:32 2005
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
 	<head>
-		<META HTTP-EQUIV="Refresh" CONTENT="0;URL=./Forms/Directory.aspx">
+		<META HTTP-EQUIV="Refresh" CONTENT="0;URL=./Forms/Directory2.aspx">
 	</head>
 	<body>
 		<p>Loading...</p>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org