Author: husted
Date: Tue Sep 13 12:36:07 2005
New Revision: 280633

URL: http://svn.apache.org/viewcvs?rev=280633&view=rev
Log:
OVR-21
* Continue refactorings for user controls.

Added:
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.cs
    
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.resx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.resx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.resx
    struts/sandbox/trunk/overdrive/PhoneBook/prebuild.bat
Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx
    struts/sandbox/trunk/overdrive/PhoneBook/PhoneBook.sln
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder.ascx.cs
    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/Forms/Directory2.aspx.cs
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/Catalog.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Query/SelectAll.xml
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/App.cs Tue Sep 13 12:36:07 
2005
@@ -124,27 +124,17 @@
                public const string HOURS_LIST = "hours_list";
 
                /// <summary>
-               /// Token for Directory View command.
+               /// Token for Entry Find command.
                /// </summary>
                /// 
-               public const string DIRECTORY_VIEW = "directory_view";
-
-               #endregion
-
-               #region Helpers
+               public const string ENTRY_FIND = "entry_find";
 
                /// <summary>
-               /// Token for Directory Find helper.
+               /// Token for Entry Save command.
                /// </summary>
                /// 
-               public const string DIRECTORY_FIND_HELPER = 
"directory_find_helper";
-
-               /// <summary>
-               /// Token for Directory list helper.
-               /// </summary>
-               /// 
-               public const string DIRECTORY_LIST_HELPER = 
"directory_list_helper";
-
+               public const string ENTRY_SAVE = "entry_save";
+               
                #endregion
 
                #region Messages

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Core/Messages.resx Tue Sep 13 
12:36:07 2005
@@ -43,10 +43,13 @@
 
     <!-- command labels -->
 
-    <data name="list_all_command">
-      <value>SHOW ALL</value>
+    <data name="find">
+      <value>LIST ALL</value>
     </data>
 
+    <data name="add">
+      <value>ADD</value>
+    </data>
 
     <!-- field alerts -->
 

Modified: struts/sandbox/trunk/overdrive/PhoneBook/PhoneBook.sln
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/PhoneBook.sln?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/PhoneBook.sln (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/PhoneBook.sln Tue Sep 13 12:36:07 
2005
@@ -32,6 +32,9 @@
                {2F4D056B-4211-4A17-8F47-37901085B3AE}.Release.ActiveCfg = 
Release|.NET
                {2F4D056B-4211-4A17-8F47-37901085B3AE}.Release.Build.0 = 
Release|.NET
        EndGlobalSection
+       GlobalSection(SolutionItems) = postSolution
+               prebuild.bat = prebuild.bat
+       EndGlobalSection
        GlobalSection(ExtensibilityGlobals) = postSolution
        EndGlobalSection
        GlobalSection(ExtensibilityAddIns) = postSolution

Modified: 
struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/DirectoryViewTest.cs 
Tue Sep 13 12:36:07 2005
@@ -9,7 +9,7 @@
        /// </summary>
        /// 
        [TestFixture]
-       public class DirectoryViewTest : BaseTest
+       public class EntryFindTest : BaseTest
        {
                /// <summary>
                /// Confirm that Context contains the expected attributes for 
the list filter-0ps.
@@ -18,7 +18,7 @@
                [Test]
                public void ContainsFilters()
                {
-                       IRequestContext context = 
catalog.ExecuteRequest(App.DIRECTORY_VIEW);
+                       IRequestContext context = 
catalog.ExecuteRequest(App.ENTRY_FIND);
                        this.AssertNominal(context);
                        string[] FILTERS = {App.LAST_NAME_LIST, 
App.FIRST_NAME_LIST, App.EXTENSION_LIST, App.USER_NAME_LIST, App.HIRED_LIST, 
App.HOURS_LIST};
                        foreach (string filter in FILTERS)
@@ -33,10 +33,10 @@
                [Test]
                public void HelperContains()
                {
-                       IViewHelper helper = 
catalog.GetHelperFor(App.DIRECTORY_VIEW);
+                       IViewHelper helper = 
catalog.GetHelperFor(App.ENTRY_FIND);
                        IRequestCommand command = helper.Command;
                        Assert.IsNotNull(command, "Expected Helper to have a 
Command");
-                       Assert.AreEqual(App.DIRECTORY_VIEW, command.ID, 
"Expected Helper to have View Command.");
+                       Assert.AreEqual(App.ENTRY_FIND, command.ID, "Expected 
Helper to have View Command.");
                }
        }
 }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Commands/FilterLists.cs Tue 
Sep 13 12:36:07 2005
@@ -71,7 +71,7 @@
 
                private IKeyValueList FilterList(string key)
                {
-                       IViewHelper helper = 
catalog.GetHelperFor(App.DIRECTORY_VIEW);
+                       IViewHelper helper = 
catalog.GetHelperFor(App.ENTRY_FIND);
                        helper.Execute();
                        IKeyValueList list = helper.Criteria[key] as 
IKeyValueList;
                        Assert.IsNotNull(list, "Expected KeyValueList");

Modified: 
struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Command/Catalog.xml 
Tue Sep 13 12:36:07 2005
@@ -76,9 +76,9 @@
   
        <!-- chains -->
 
-    <object id="directory_view" parent="BaseChain">
+    <object id="entry_find" parent="BaseChain">
                <property name="ID">
-                       <value>directory_view</value>
+                       <value>entry_find</value>
                </property>
                <property name="AddCommands">
                        <list>
@@ -91,60 +91,7 @@
                        </list>
                </property>
        </object>
-       
-               
-  <!-- directory1 helpers -->
-
-  <object id="directory_find_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="directory_view" />
-               </property>
-  </object>
-
-  <object id="directory_list_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="entry_list" />
-               </property>
-  </object>
-  
-  <!-- directory2 helpers -->
-  
-       <!-- Note that the FieldSet refers to FieldContext objects 
(AppField.xml) -->
-  <object id="directory_grid_helper" parent="BaseGridHelper" singleton="false">
-               <property name="FindHelper">
-                       <ref object="directory_find_helper"/>
-               </property>             
-               <property name="ListHelper">
-                       <ref object="directory_list_helper" />
-               </property>
-               <property name="SaveHelper">
-                       <ref object="entry_save_helper" />
-               </property>
-               <property name="HasCriteria">
-                       <value>true</value>
-               </property>
-               <property name="DataKeyField">
-                       <value>entry_key</value>
-               </property>
-               <property name="FieldSet">
-                       <list>
-                               <ref object="first_name"/>
-                               <ref object="last_name"/>
-                               <ref object="extension"/> 
-                               <ref object="user_name"/>
-                               <ref object="hired"/> 
-                               <ref object="hours"/>
-                               <ref object="editor"/>
-                       </list>
-               </property>
-       </object>  
-
-  <object id="entry_save_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="entry_save" />
-               </property>
-  </object>
-
+                       
   <object id="entry_save" type="PhoneBook.Core.Commands.BaseSave, 
PhoneBook.Core">
                <property name="ID">
                        <value>entry_save</value>
@@ -176,10 +123,4 @@
                </property>
        </object>
 
-  <object id="directory_entry_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="entry" />
-               </property>
-  </object>
-         
 </objects>

Modified: 
struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Test/Resources/Query/SelectAll.xml 
Tue Sep 13 12:36:07 2005
@@ -68,7 +68,7 @@
                                user_name,
                                hired,
                                hours,
-                               editor
+                               editor,
                                pk_entry
                                )
                        VALUES (?,?,?,?, ?,?,?,?)

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx 
(added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx 
Tue Sep 13 12:36:07 2005
@@ -0,0 +1 @@
+<%@ Control Language="c#" AutoEventWireup="false" 
Codebehind="AppGridControl.ascx.cs" 
Inherits="PhoneBook.Web.Controls.AppGridControl" 
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>

Added: 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.cs?rev=280633&view=auto
==============================================================================
--- 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.cs 
(added)
+++ 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.cs 
Tue Sep 13 12:36:07 2005
@@ -0,0 +1,41 @@
+using System;
+using Nexus.Core;
+using Nexus.Web.Controls;
+using PhoneBook.Core;
+
+namespace PhoneBook.Web.Controls
+{
+       public class AppGridControl : GridControl
+       {
+
+               public override IEntryList NewContextList
+               {
+                       get { return new AppEntryList(); }
+               }
+
+               private void Page_Load(object sender, System.EventArgs e)
+               {
+                       // Put user code to initialize the page here
+               }
+
+               #region Web Form Designer generated code
+               override protected void OnInit(EventArgs e)
+               {
+                       //
+                       // CODEGEN: This call is required by the ASP.NET Web 
Form Designer.
+                       //
+                       InitializeComponent();
+                       base.OnInit(e);
+               }
+               
+               /// <summary>
+               ///             Required method for Designer support - do not 
modify
+               ///             the contents of this method with the code 
editor.
+               /// </summary>
+               private void InitializeComponent()
+               {
+                       this.Load += new System.EventHandler(this.Page_Load);
+               }
+               #endregion
+       }
+}

Added: 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.resx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.resx?rev=280633&view=auto
==============================================================================
--- 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.resx 
(added)
+++ 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/AppGridControl.ascx.resx 
Tue Sep 13 12:36:07 2005
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<root>
+       <xsd:schema id="root" xmlns="" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+               <xsd:element name="root" msdata:IsDataSet="true">
+                       <xsd:complexType>
+                               <xsd:choice maxOccurs="unbounded">
+                                       <xsd:element name="data">
+                                               <xsd:complexType>
+                                                       <xsd:sequence>
+                                                               <xsd:element 
name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                                                               <xsd:element 
name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+                                                       </xsd:sequence>
+                                                       <xsd:attribute 
name="name" type="xsd:string" />
+                                                       <xsd:attribute 
name="type" type="xsd:string" />
+                                                       <xsd:attribute 
name="mimetype" type="xsd:string" />
+                                               </xsd:complexType>
+                                       </xsd:element>
+                                       <xsd:element name="resheader">
+                                               <xsd:complexType>
+                                                       <xsd:sequence>
+                                                               <xsd:element 
name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                                                       </xsd:sequence>
+                                                       <xsd:attribute 
name="name" type="xsd:string" use="required" />
+                                               </xsd:complexType>
+                                       </xsd:element>
+                               </xsd:choice>
+                       </xsd:complexType>
+               </xsd:element>
+       </xsd:schema>
+       <resheader name="ResMimeType">
+               <value>text/microsoft-resx</value>
+       </resheader>
+       <resheader name="Version">
+               <value>1.0.0.0</value>
+       </resheader>
+       <resheader name="Reader">
+               <value>System.Resources.ResXResourceReader, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
+       </resheader>
+       <resheader name="Writer">
+               <value>System.Resources.ResXResourceWriter, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
+       </resheader>
+</root>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder.ascx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder.ascx.cs?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder.ascx.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder.ascx.cs Tue 
Sep 13 12:36:07 2005
@@ -53,7 +53,7 @@
 
                public void Open()
                {
-                       IViewHelper h = this.ExecuteBind(App.DIRECTORY_VIEW);
+                       IViewHelper h = this.ExecuteBind(App.ENTRY_FIND);
                        bool ok = (h.IsNominal);
                        if (!ok)
                                Page_Error = h;
@@ -63,7 +63,7 @@
                {
                        if (Click == null) return;
                        Filter_Reset(null);
-                       IViewHelper helper = Read(App.DIRECTORY_VIEW);
+                       IViewHelper helper = Read(App.ENTRY_FIND);
                        Click(this, new ViewArgs(helper));
                }
 

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx Tue Sep 
13 12:36:07 2005
@@ -0,0 +1,25 @@
+<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Finder2.ascx.cs" 
Inherits="PhoneBook.Web.Controls.Finder2" 
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
+<table>
+       <tr>
+               <td colspan="6" >
+                       <asp:Button ID="find" Runat="server"></asp:Button>
+                       <INPUT onclick="javascript:window.print();" 
type="button" value="PRINT" name="cmd_print" id="cmd_print">
+               </td>
+       </tr>
+       <tr>
+               <td><asp:Label runat="server" 
id="last_name_label"></asp:label></td>
+               <td><asp:Label runat="server" 
id="first_name_label"></asp:label></td>
+               <td><asp:Label runat="server" 
id="extension_label"></asp:Label></td>
+               <td><asp:Label runat="server" 
id="user_name_label"></asp:Label></td>
+               <td><asp:Label runat="server" id="hired_label"></asp:Label></td>
+               <td><asp:Label runat="server" 
id="hours_label"></asp:Label></td>                          
+       </tr>
+       <tr>
+               <td><asp:DropDownList ID="last_name_list" 
Runat=server></asp:DropDownList></td>
+               <td><asp:DropDownList ID="first_name_list" 
Runat=server></asp:DropDownList></td>
+               <td><asp:DropDownList ID="extension_list" 
Runat=server></asp:DropDownList></td>
+               <td><asp:DropDownList ID="user_name_list" 
Runat=server></asp:DropDownList></td>
+               <td><asp:DropDownList ID="hired_list" 
Runat=server></asp:DropDownList></td>
+               <td><asp:DropDownList ID="hours_list" 
Runat=server></asp:DropDownList></td>
+       </tr>
+</table>

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.cs?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.cs 
(added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.cs Tue 
Sep 13 12:36:07 2005
@@ -0,0 +1,129 @@
+using System;
+using System.Web.UI.WebControls;
+using Nexus.Core.Helpers;
+using Nexus.Web.Controls;
+using PhoneBook.Core;
+
+namespace PhoneBook.Web.Controls
+{
+
+       public class Finder2 : ViewControl
+       {
+
+               public Label last_name_label;
+               public Label first_name_label;
+               public Label extension_label;
+               public Label user_name_label;
+               public Label hired_label;
+               public Label hours_label;
+
+               protected DropDownList last_name_list;
+               protected DropDownList first_name_list;
+               protected DropDownList extension_list;
+               protected DropDownList user_name_list;
+               protected DropDownList hired_list;
+               protected DropDownList hours_list;
+               
+               protected Button find;
+
+               /// <summary>
+               /// Fires when search criteria is input.
+               /// </summary>
+               public event EventHandler Click;
+
+               private Label[] FilterLabels()
+               {
+                       Label[] labels = {last_name_label, first_name_label, 
extension_label, user_name_label, hired_label, hours_label};
+                       return labels;
+               }
+
+               private DropDownList[] FilterList()
+               {
+                       DropDownList[] lists = {last_name_list, 
first_name_list, extension_list, user_name_list, hired_list, hours_list};
+                       return lists;
+               }
+
+               private void find_Click(object sender, EventArgs e)
+               {
+                       if (Click == null) return;
+                       Filter_Reset(null);
+                       IViewHelper helper = Read(App.ENTRY_FIND);
+                       Click(this, new ViewArgs(helper));
+               }
+
+               private void Filter_Reset(DropDownList except)
+               {
+                       // Reset filter controls
+                       int exceptIndex = 0;
+                       if (except != null) exceptIndex = except.SelectedIndex;
+                       foreach (DropDownList filter in FilterList())
+                       {
+                               filter.SelectedIndex = 0;
+                       }
+                       if (except != null) except.SelectedIndex = exceptIndex;
+                       // Tell everyone that we are starting over
+               }
+
+               private void Filter_Changed(object sender, EventArgs e)
+               {
+                       IViewHelper helper = 
Catalog.GetHelperFor(App.ENTRY_LIST);
+                       DropDownList list = sender as DropDownList;
+                       string id = list.ID;
+                       int v = id.LastIndexOf(helper.ListSuffix);
+                       string key = id.Substring(0, v);
+                       helper.Criteria[key] = list.SelectedValue;
+                       Filter_Reset(list);
+                       Click(this, new ViewArgs(helper));
+               }
+
+               public void Open()
+               {
+                       IViewHelper h = GetHelperFor(App.ENTRY_FIND);
+                       ExecuteBind(h);
+                       bool ok = (h.IsNominal);
+                       if (!ok)
+                               Page_Error = h;
+               }
+
+               private void Page_Load(object sender, System.EventArgs e)
+               {
+                       find.Click += new EventHandler(find_Click);
+                       foreach (DropDownList filter in FilterList())
+                       {
+                               filter.SelectedIndexChanged += new 
EventHandler(Filter_Changed);
+                       }
+                       if (!IsPostBack)
+                       {
+                               find.Text = GetMessage(find.ID);
+                               foreach (Label label in FilterLabels())
+                               {
+                                       label.Text = GetMessage(label.ID);
+                               }                               
+                               foreach (DropDownList filter in FilterList())
+                               {
+                                       filter.AutoPostBack = true;
+                               }
+                       }
+               }
+
+               #region Web Form Designer generated code
+               override protected void OnInit(EventArgs e)
+               {
+                       //
+                       // CODEGEN: This call is required by the ASP.NET Web 
Form Designer.
+                       //
+                       InitializeComponent();
+                       base.OnInit(e);
+               }
+               
+               /// <summary>
+               ///             Required method for Designer support - do not 
modify
+               ///             the contents of this method with the code 
editor.
+               /// </summary>
+               private void InitializeComponent()
+               {
+                       this.Load += new System.EventHandler(this.Page_Load);
+               }
+               #endregion
+       }
+}

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.resx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.resx?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.resx 
(added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Finder2.ascx.resx Tue 
Sep 13 12:36:07 2005
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<root>
+       <xsd:schema id="root" xmlns="" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+               <xsd:element name="root" msdata:IsDataSet="true">
+                       <xsd:complexType>
+                               <xsd:choice maxOccurs="unbounded">
+                                       <xsd:element name="data">
+                                               <xsd:complexType>
+                                                       <xsd:sequence>
+                                                               <xsd:element 
name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                                                               <xsd:element 
name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+                                                       </xsd:sequence>
+                                                       <xsd:attribute 
name="name" type="xsd:string" />
+                                                       <xsd:attribute 
name="type" type="xsd:string" />
+                                                       <xsd:attribute 
name="mimetype" type="xsd:string" />
+                                               </xsd:complexType>
+                                       </xsd:element>
+                                       <xsd:element name="resheader">
+                                               <xsd:complexType>
+                                                       <xsd:sequence>
+                                                               <xsd:element 
name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                                                       </xsd:sequence>
+                                                       <xsd:attribute 
name="name" type="xsd:string" use="required" />
+                                               </xsd:complexType>
+                                       </xsd:element>
+                               </xsd:choice>
+                       </xsd:complexType>
+               </xsd:element>
+       </xsd:schema>
+       <resheader name="ResMimeType">
+               <value>text/microsoft-resx</value>
+       </resheader>
+       <resheader name="Version">
+               <value>1.0.0.0</value>
+       </resheader>
+       <resheader name="Reader">
+               <value>System.Resources.ResXResourceReader, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
+       </resheader>
+       <resheader name="Writer">
+               <value>System.Resources.ResXResourceWriter, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
+       </resheader>
+</root>

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx Tue Sep 
13 12:36:07 2005
@@ -0,0 +1,6 @@
+<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Lister2.ascx.cs" 
Inherits="PhoneBook.Web.Controls.Lister2" 
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
+<asp:DataGrid id="list" Runat="server" AutoGenerateColumns=False>
+       <HeaderStyle CssClass="HeaderStyle" BackColor="#CCCC99"></HeaderStyle>
+       <AlternatingItemStyle CssClass="AlternatingItemStyle" 
BackColor="#CCCC99"></AlternatingItemStyle>
+</asp:DataGrid>
+<p><asp:Button ID="add" Runat="server"></asp:Button></p>

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs 
(added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs Tue 
Sep 13 12:36:07 2005
@@ -0,0 +1,97 @@
+using System.Collections;
+using System.Web.UI.WebControls;
+using Nexus.Core.Helpers;
+using PhoneBook.Core;
+
+namespace PhoneBook.Web.Controls
+{
+       using System;
+
+       public class Lister2 : AppGridControl
+       {
+
+               protected DataGrid list;
+               protected Button add;
+
+               public void Open(IDictionary criteria)
+               {
+                       // list_ResetIndex(); -- what about saving the criteria?
+                       IViewHelper helper = ReadExecute(App.ENTRY_LIST, 
criteria);
+                       bool ok = helper.IsNominal;
+                       if (!ok) Page_Error = helper;
+                       else
+                       {
+                               IList result = helper.Outcome;
+                               list.DataSource = result;
+                               list.DataBind();
+                       }
+               }
+
+               private static string LABEL = "_label";
+
+               private void SetProperties()
+               {
+                       FindCommand = App.ENTRY_FIND;
+                       ListCommand = App.ENTRY_LIST;
+                       SaveCommand = App.ENTRY_SAVE;
+                       DataKeyField = App.ENTRY_KEY;
+                       HasItemColumn = false;
+                       // AppUserProfile profile = 
Session[UserProfile.USER_PROFILE] as AppUserProfile;
+                       HasEditColumn = true; // profile.IsEditor;
+
+                       IList f = new ArrayList(7);
+                       f.Add(App.LAST_NAME);
+                       f.Add(App.FIRST_NAME);
+                       f.Add(App.EXTENSION);
+                       f.Add(App.USER_NAME);
+                       f.Add(App.HIRED);
+                       f.Add(App.HOURS);
+                       f.Add(App.EDITOR);
+                       DataFields = f;
+
+                       IList k = new ArrayList(7);
+                       k.Add(GetMessage(App.LAST_NAME  + LABEL));
+                       k.Add(GetMessage(App.FIRST_NAME + LABEL));
+                       k.Add(GetMessage(App.EXTENSION  + LABEL));
+                       k.Add(GetMessage(App.USER_NAME  + LABEL));
+                       k.Add(GetMessage(App.HIRED      + LABEL));
+                       k.Add(GetMessage(App.HOURS      + LABEL));
+                       k.Add(GetMessage(App.EDITOR     + LABEL));
+                       DataLabels = k;
+               }
+
+               private void Page_Init()
+               {
+                       Grid = list;                    
+               }
+
+               private void Page_Load(object sender, System.EventArgs e)
+               {
+                       SetProperties();
+                       add.Click += new EventHandler(list_Add);
+                       add.Text = GetMessage(add.ID);
+               }
+
+               #region Web Form Designer generated code
+               override protected void OnInit(EventArgs e)
+               {
+                       //
+                       // CODEGEN: This call is required by the ASP.NET Web 
Form Designer.
+                       //
+                       InitializeComponent();
+                       base.OnInit(e);
+                       Page_Init();
+               }
+               
+               /// <summary>
+               ///             Required method for Designer support - do not 
modify
+               ///             the contents of this method with the code 
editor.
+               /// </summary>
+               private void InitializeComponent()
+               {
+                       this.Load += new EventHandler(this.Page_Load);
+               }
+
+               #endregion
+       }
+}

Added: struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.resx
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.resx?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.resx 
(added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.resx Tue 
Sep 13 12:36:07 2005
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<root>
+       <xsd:schema id="root" xmlns="" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+               <xsd:element name="root" msdata:IsDataSet="true">
+                       <xsd:complexType>
+                               <xsd:choice maxOccurs="unbounded">
+                                       <xsd:element name="data">
+                                               <xsd:complexType>
+                                                       <xsd:sequence>
+                                                               <xsd:element 
name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                                                               <xsd:element 
name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+                                                       </xsd:sequence>
+                                                       <xsd:attribute 
name="name" type="xsd:string" />
+                                                       <xsd:attribute 
name="type" type="xsd:string" />
+                                                       <xsd:attribute 
name="mimetype" type="xsd:string" />
+                                               </xsd:complexType>
+                                       </xsd:element>
+                                       <xsd:element name="resheader">
+                                               <xsd:complexType>
+                                                       <xsd:sequence>
+                                                               <xsd:element 
name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                                                       </xsd:sequence>
+                                                       <xsd:attribute 
name="name" type="xsd:string" use="required" />
+                                               </xsd:complexType>
+                                       </xsd:element>
+                               </xsd:choice>
+                       </xsd:complexType>
+               </xsd:element>
+       </xsd:schema>
+       <resheader name="ResMimeType">
+               <value>text/microsoft-resx</value>
+       </resheader>
+       <resheader name="Version">
+               <value>1.0.0.0</value>
+       </resheader>
+       <resheader name="Reader">
+               <value>System.Resources.ResXResourceReader, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
+       </resheader>
+       <resheader name="Writer">
+               <value>System.Resources.ResXResourceWriter, 
System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089</value>
+       </resheader>
+</root>

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=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx Tue Sep 
13 12:36:07 2005
@@ -1,6 +1,6 @@
-<%@ Page language="c#" Codebehind="Directory.aspx.cs" AutoEventWireup="true" 
Inherits="PhoneBook.Web.Forms.Directory" %>
-<%@ Register TagPrefix="my" TagName="Finder" Src="../Controls/Finder.ascx" %>
-<%@ Register TagPrefix="my" TagName="Lister" Src="../Controls/Lister.ascx" %>
+<%@ Page language="c#" Codebehind="Directory.aspx.cs" AutoEventWireup="false" 
Inherits="PhoneBook.Web.Forms.Directory" %>
+<%@ Register TagPrefix="app" TagName="Finder" Src="../Controls/Finder.ascx" %>
+<%@ Register TagPrefix="app" TagName="Lister" Src="../Controls/Lister.ascx" %>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <HTML>
@@ -14,20 +14,20 @@
        </HEAD>
        <body>
                <h1>PhoneBook Directory</h1>
-                       <form id="frmDirectory" method="post" runat="server">
+                       <form id="form" method="post" runat="server">
                        
                        <!-- ERROR -->
-                       <asp:Panel ID="pnlError" Runat="server">
-                       <p><asp:Label ID="lblError" 
Runat="server"></asp:Label></p>
+                       <asp:Panel ID="error_panel" Runat="server">
+                       <p><asp:Label ID="error_label" 
Runat="server"></asp:Label></p>
                        <hr>
                        </asp:Panel>
                        
                        <!-- PROMPT -->
                        <p>Select a filter to display fewer entries.</p>        
 
-                       <my:Finder id="finder" Runat="server" 
OnClick="finder_Click"></my:Finder>
+                       <app:Finder id="finder" Runat="server" 
OnClick="finder_Click"></app:Finder>
                        
-                       <my:Lister id="lister" runat="server" 
OnClick="lister_Click"></my:Lister>
+                       <app:Lister id="lister" runat="server" 
OnClick="lister_Click"></app:Lister>
 
                </form>
        </body>

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=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory.aspx.cs Tue 
Sep 13 12:36:07 2005
@@ -22,8 +22,8 @@
 
                #region Page Properties 
 
-               protected Panel pnlError;
-               protected Label lblError;
+               protected Panel error_panel;
+               protected Label error_label;
 
                /// <summary>
                /// Display a list of error messages.
@@ -32,8 +32,8 @@
                {
                        set
                        {
-                               lblError.Text = value.ErrorsText;
-                               pnlError.Visible = true;
+                               error_label.Text = value.ErrorsText;
+                               error_panel.Visible = true;
                        }
                }
 
@@ -55,7 +55,7 @@
 
                #endregion
 
-               #region Control Events
+               #region Event handlers
 
                protected Lister lister;
                protected Finder finder;
@@ -86,17 +86,38 @@
                        c.Catalog = this.Catalog; // ISSUE: Why isn't control 
injection working?
                }
 
-               protected void Page_Init()
+               private void Page_Init()
                {
                        View_Init(finder);
                        View_Init(lister);
                }
 
-               protected void Page_Load(object sender, EventArgs e)
+               private void Page_Load(object sender, EventArgs e)
                {
-                       pnlError.Visible = false;
+                       error_panel.Visible = false;
                }
 
                #endregion
-       }
+
+               #region Web Form Designer generated code
+               override protected void OnInit(EventArgs e)
+               {
+                       //
+                       // CODEGEN: This call is required by the ASP.NET Web 
Form Designer.
+                       //
+                       InitializeComponent();
+                       base.OnInit(e);
+                       Page_Init();
+               }
+               
+               /// <summary>
+               ///             Required method for Designer support - do not 
modify
+               ///             the contents of this method with the code 
editor.
+               /// </summary>
+               private void InitializeComponent()
+               {
+                       this.Load += new System.EventHandler(this.Page_Load);
+               }
+               #endregion
+       }       
 }

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=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx Tue Sep 
13 12:36:07 2005
@@ -1,5 +1,8 @@
 <%@ Register TagPrefix="ovr" Namespace="Nexus.Web" Assembly="Nexus.Web" %>
-<%@ Page language="c#" Codebehind="Directory2.aspx.cs" AutoEventWireup="true" 
Inherits="PhoneBook.Web.Forms.Directory2" %>
+<%@ Page language="c#" Codebehind="Directory2.aspx.cs" AutoEventWireup="false" 
Inherits="PhoneBook.Web.Forms.Directory2" %>
+<%@ Register TagPrefix="app" TagName="Finder" Src="../Controls/Finder2.ascx" %>
+<%@ Register TagPrefix="app" TagName="Lister" Src="../Controls/Lister2.ascx" %>
+
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <HTML>
        <HEAD>
@@ -11,6 +14,7 @@
                <LINK href="default.css" type="text/css" rel="stylesheet">
        </HEAD>
        <body>
+       
                <h1 id="heading" runat="server"></h1>
                        <form id="form" method="post" runat="server">
                        <p><asp:Label ID="greeting" Runat="server"></asp:Label> 
<asp:Label ID="profile_label" Runat="server"></asp:Label></p>
@@ -27,41 +31,10 @@
                        <hr>
                        </asp:Panel>
                                                
-                       <!-- FIND -->
-                       <asp:Panel ID="find_panel" Runat="server">
-                         <table><tr>
-                         <td colspan="6" >
-                                 <asp:Button ID="list_all_command" 
Runat="server"></asp:Button>
-                                 <INPUT onclick="javascript:window.print();" 
type="button" value="PRINT" name="cmd_print" id="cmd_print">
-                         </td>
-                         <tr>
-                         <td><asp:Label runat="server" 
id="last_name_label"></asp:label></td>
-                         <td><asp:Label runat="server" 
id="first_name_label"></asp:label></td>
-                         <td><asp:Label runat="server" 
id="extension_label"></asp:Label></td>
-                         <td><asp:Label runat="server" 
id="user_name_label"></asp:Label></td>
-                         <td><asp:Label runat="server" 
id="hired_label"></asp:Label></td>
-                         <td><asp:Label runat="server" 
id="hours_label"></asp:Label></td>                        
-                         </tr><tr>
-                         <td><asp:DropDownList ID="last_name_list" 
Runat=server></asp:DropDownList></td>
-                         <td><asp:DropDownList ID="first_name_list" 
Runat=server></asp:DropDownList></td>
-                         <td><asp:DropDownList ID="extension_list" 
Runat=server></asp:DropDownList></td>
-                         <td><asp:DropDownList ID="user_name_list" 
Runat=server></asp:DropDownList></td>
-                         <td><asp:DropDownList ID="hired_list" 
Runat=server></asp:DropDownList></td>
-                         <td><asp:DropDownList ID="hours_list" 
Runat=server></asp:DropDownList></td>
-                         </tr></table>
-                       </asp:panel>
+                       <app:Finder id="finder" Runat="server" 
OnClick="finder_Click"></app:Finder>
+                       
+                       <app:Lister id="lister" runat="server" 
OnClick="lister_Click"></app:Lister>
                        
-                       <!-- LIST -->                   
-                       <asp:Panel ID="list_panel" Runat="server">
-               <ovr:NexusDataGrid id="list_report" Runat="server" 
-                                       PagerStyle-Mode="NumericPages" 
AllowPaging="true" PageSize="2" >
-                                       <HeaderStyle CssClass="HeaderStyle" 
BackColor="#CCCC99"></HeaderStyle>
-                                       <AlternatingItemStyle 
CssClass="AlternatingItemStyle" BackColor="#CCCC99"></AlternatingItemStyle>
-                                       <EditItemStyle 
CssClass="EditItemStyle"></EditItemStyle>
-               </ovr:NexusDataGrid>
-                       <p><asp:Button ID="list_add_command" 
Runat="server"></asp:Button></p>
-                       </asp:Panel>
-
                </form>
        </body>
 </HTML>

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Directory2.aspx.cs Tue 
Sep 13 12:36:07 2005
@@ -2,10 +2,13 @@
 using System.Security.Principal;
 using System.Web.UI.HtmlControls;
 using System.Web.UI.WebControls;
+using Nexus.Core;
 using Nexus.Core.Helpers;
 using Nexus.Core.Profile;
-using Nexus.Web;
+using Nexus.Web.Controls;
 using PhoneBook.Core;
+using PhoneBook.Web.Controls;
+using Spring.Web.UI;
 
 namespace PhoneBook.Web.Forms
 {
@@ -13,23 +16,8 @@
        ///  Maintain a list of employees with their telephone extension 
[OVR-5]. 
        /// </summary>
        /// 
-       public class Directory2 : BaseGridPage
+       public class Directory2 : Page
        {
-               #region Helpers 
-
-               private IViewHelper _UserHelper;
-
-               /// <summary>
-               /// Obtain entry for a user.
-               /// </summary>
-               ///
-               public virtual IViewHelper UserHelper
-               {
-                       get { return _UserHelper; }
-                       set { _UserHelper = value; }
-               }
-
-               #endregion
 
                #region Page Properties 
 
@@ -41,7 +29,9 @@
                protected Label error_label;
 
                private AppUserProfile _Profile;
-
+               /// <summary>
+               ///  Obtain a profile for a user.
+               /// </summary>
                protected AppUserProfile Profile
                {
                        set
@@ -55,17 +45,24 @@
                        get { return _Profile; }
                }
 
+               /// <summary>
+               /// Create or retrieve an AppUserProfile 
+               /// based on the client's WindowsIdentity.
+               /// </summary>
+               /// <returns>A new or prexisting AppUserProfile</returns>
                protected AppUserProfile NewProfile()
                {
                        WindowsIdentity id = WindowsIdentity.GetCurrent();
                        AppUserProfile profile = new AppUserProfile(id);
                        Session[UserProfile.USER_PROFILE] = profile;
 
-                       UserHelper.Criteria[App.USER_NAME] = profile.UserId;
-                       UserHelper.Execute();
-                       if (UserHelper.IsNominal)
+                       IViewHelper helper = 
Catalog.GetHelperFor(App.ENTRY_LIST);
+                       helper.Criteria[App.USER_NAME] = profile.UserId;
+                       helper.Execute();
+                       if (helper.IsNominal)
                        {
-                               string editor = UserHelper.Criteria[App.EDITOR] 
as string;
+                               string editor = helper.Criteria[App.EDITOR] as 
string;
+                               // ISSUE: Need constant for "1" (true)
                                bool isEditor = ((editor != null) && 
(editor.Equals("1")));
                                profile.IsEditor = isEditor;
                        }
@@ -74,9 +71,9 @@
                }
 
                /// <summary>
-               /// Display a list of error mesasges.
+               /// Display a list of error messagess.
                /// </summary>
-               protected override IViewHelper Page_Error
+               protected IViewHelper Page_Error
                {
                        set
                        {
@@ -89,151 +86,111 @@
                protected Label prompt_label;
 
                /// <summary>
-               /// Display a Prompt mesasges.
+               /// Display a Prompt message.
                /// </summary>
-               protected override string Page_Prompt
+               protected string Page_Prompt
                {
                        set { prompt_label.Text = value; }
                }
 
-               #endregion
+               private IRequestCatalog _Catalog;
 
-               #region Find -- Display Find controls
-
-               protected Panel find_panel;
-               public Label last_name_label;
-               public Label first_name_label;
-               public Label extension_label;
-               public Label user_name_label;
-               public Label hired_label;
-               public Label hours_label;
-               protected DropDownList last_name_list;
-               protected DropDownList first_name_list;
-               protected DropDownList extension_list;
-               protected DropDownList user_name_list;
-               protected DropDownList hired_list;
-               protected DropDownList hours_list;
-               // TODO: protected DropDownList editor_list;
-               protected Button list_all_command;
-
-               // pageload events - These methods populate controls to display
-
-               private Label[] FilterLabels()
+               /// <summary>
+               /// Provide reference ot the Catalog (object factory) for this 
application. 
+               /// </summary>
+               /// <remarks><p>
+               /// Subclasses adding EventHandlers 
+               /// should pass a reference to themselves with a ViewArgs 
instance, 
+               /// encapsulating the Helper.
+               /// </p></remarks>
+               public virtual IRequestCatalog Catalog
                {
-                       Label[] labels = {last_name_label, first_name_label, 
extension_label, user_name_label, hired_label, hours_label};
-                       return labels;
+                       get { return _Catalog; }
+                       set { _Catalog = value; }
                }
 
-               private DropDownList[] FilterList()
-               {
-                       DropDownList[] lists = {last_name_list, 
first_name_list, extension_list, user_name_list, hired_list, hours_list};
-                       return lists;
-               }
+               #endregion
+
+               #region Event handlers
+
+               protected Lister2 lister;
+               protected Finder2 finder;
 
-               private void ListAll_Click(object sender, EventArgs e)
+               protected void finder_Click(object sender, EventArgs e)
                {
-                       Filter_Reset(null);
-                       List_Load();
+                       ViewArgs a = e as ViewArgs;
+                       IViewHelper helper = a.Helper;
+                       lister.Open(helper.Criteria);
                }
 
-               protected override void Find_Init()
-               {
-                       base.Find_Init();
-                       list_all_command.Click += new 
EventHandler(ListAll_Click);
-                       list_all_command.Text = GetMessage(list_all_command.ID);
+               #endregion
 
-                       foreach (Label label in FilterLabels())
-                       {
-                               label.Text = GetMessage(label.ID);
-                       }
+               #region Page Events
 
-                       foreach (DropDownList filter in FilterList())
-                       {
-                               filter.AutoPostBack = true;
-                               filter.SelectedIndexChanged += new 
EventHandler(Find_Submit);
-                       }
+               private void View_Error(object sender, EventArgs e)
+               {
+                       ViewArgs v = e as ViewArgs;
+                       if (v == null) throw new ArgumentException("View_Error: 
!(e is ViewArgs)");
+                       IViewHelper helper = v.Helper;
+                       if (helper != null) Page_Error = helper;
+                       else throw new ArgumentException("View_Error: 
(e.helper==null)");
                }
 
-               private string GetRootID(string id)
+               private void View_Init(ViewControl c)
                {
-                       int v = 
id.LastIndexOf(GridHelper.FindHelper.ListSuffix);
-                       string key = id.Substring(0, v);
-                       return key;
+                       c.View_Error += new EventHandler(View_Error);
+                       c.Catalog = this.Catalog; // ISSUE: Why isn't control 
injection working?
                }
 
-               private void Filter_Reset(DropDownList except)
+               private void Page_Init()
                {
-                       // Reset filter controls
-                       int exceptIndex = 0;
-                       if (except != null) exceptIndex = except.SelectedIndex;
-                       foreach (DropDownList filter in FilterList())
-                       {
-                               filter.SelectedIndex = 0;
-                       }
-                       if (except != null) except.SelectedIndex = exceptIndex;
-                       // Tell everyone that we are starting over
-                       Page_Prompt = GetMessage(App.DIRECTORY_PROMPT);
-                       List_ResetIndex();
-               }
-
-               protected override void Find_Submit(object sender, EventArgs e)
-               {
-                       // Don't call base: base.Find_Submit (); 
-                       DropDownList list = sender as DropDownList;
-                       Filter_Reset(list);
-                       string key = GetRootID(list.ID);
-                       IGridViewHelper h = GridHelper;
-                       h.FindHelper.Criteria.Clear();
-                       h.FindHelper.Criteria[key] = list.SelectedValue;
-                       List_Criteria = GridHelper.FindHelper.Criteria;
-                       List_Load();
-               }
-
-               protected override void Find_Load()
-               {
-                       base.Find_Load();
-                       IViewHelper h = GridHelper.FindHelper;
-                       h.ExecuteBind(find_panel.Controls);
-                       bool ok = (h.IsNominal);
-                       if (!ok)
-                               Page_Error = h;
+                       Profile = Session[UserProfile.USER_PROFILE] as 
AppUserProfile;
+                       View_Init(finder);
+                       View_Init(lister);
                }
 
-               #endregion
-
-               #region Page Events
-
-               protected override void Page_Init()
+               private void Page_Load(object sender, EventArgs e)
                {
-                       base.Page_Init();
-                       list_panel.Visible = true; // base behavior hides
-                       Profile = Session[UserProfile.USER_PROFILE] as 
AppUserProfile;
-                       GridHelper.HasEditColumn = Profile.IsEditor;
-                       GridHelper.FindHelper.Profile = Profile;
-                       GridHelper.ListHelper.Profile = Profile;
-                       GridHelper.SaveHelper.Profile = Profile;
+                       error_panel.Visible = false;
                        if (!IsPostBack)
                        {
                                Page_Prompt = GetMessage(App.DIRECTORY_PROMPT);
                                profile_label.Text = Profile.UserId;
                                // UserLocale = Profile.Locale;
+                               finder.Open();
                        }
                }
 
-               protected override void Page_Load(object sender, EventArgs e)
+               private void Page_PreRender(object sender, EventArgs e)
                {
-                       base.Page_Load(sender, e);
-                       error_panel.Visible = false;
-               }
-
-               protected override void Page_PreRender(object sender, EventArgs 
e)
-               {
-                       base.Page_PreRender(sender, e);
                        greeting.Text = GetMessage(greeting.ID);
                        title.InnerText = GetMessage(App.DIRECTORY_TITLE);
                        heading.InnerText = GetMessage(App.DIRECTORY_HEADING);
                }
 
                #endregion
+
+               #region Web Form Designer generated code
+               override protected void OnInit(EventArgs e)
+               {
+                       //
+                       // CODEGEN: This call is required by the ASP.NET Web 
Form Designer.
+                       //
+                       InitializeComponent();
+                       base.OnInit(e);
+                       Page_Init();
+               }
+               
+               /// <summary>
+               ///             Required method for Designer support - do not 
modify
+               ///             the contents of this method with the code 
editor.
+               /// </summary>
+               private void InitializeComponent()
+               {
+                       this.Load += new System.EventHandler(this.Page_Load);
+                       this.PreRender += new 
System.EventHandler(this.Page_PreRender);
+               }
+               #endregion
+       
        }
 }

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Forms/Web.config Tue Sep 13 
12:36:07 2005
@@ -22,8 +22,9 @@
                </object>
               
                <object id="Directory2" type="Directory2.aspx">
-                       <property name="GridHelper"><ref 
object="directory_grid_helper"/></property>
-                       <property name="UserHelper"><ref 
object="directory_entry_helper"/></property>
+                       <property name="Catalog">
+                               <ref object="Catalog"/>
+                       </property>             
                </object>
 
           <!-- User Controls -->

Modified: 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/Catalog.xml
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/Catalog.xml?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/Catalog.xml 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Command/Catalog.xml 
Tue Sep 13 12:36:07 2005
@@ -76,9 +76,9 @@
   
        <!-- chains -->
 
-    <object id="directory_view" parent="BaseChain">
+    <object id="entry_find" parent="BaseChain">
                <property name="ID">
-                       <value>directory_view</value>
+                       <value>entry_find</value>
                </property>
                <property name="AddCommands">
                        <list>
@@ -91,60 +91,7 @@
                        </list>
                </property>
        </object>
-       
-               
-  <!-- directory1 helpers -->
-
-  <object id="directory_find_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="directory_view" />
-               </property>
-  </object>
-
-  <object id="directory_list_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="entry_list" />
-               </property>
-  </object>
-  
-  <!-- directory2 helpers -->
-  
-       <!-- Note that the FieldSet refers to FieldContext objects 
(AppField.xml) -->
-  <object id="directory_grid_helper" parent="BaseGridHelper" singleton="false">
-               <property name="FindHelper">
-                       <ref object="directory_find_helper"/>
-               </property>             
-               <property name="ListHelper">
-                       <ref object="directory_list_helper" />
-               </property>
-               <property name="SaveHelper">
-                       <ref object="entry_save_helper" />
-               </property>
-               <property name="HasCriteria">
-                       <value>true</value>
-               </property>
-               <property name="DataKeyField">
-                       <value>entry_key</value>
-               </property>
-               <property name="FieldSet">
-                       <list>
-                               <ref object="first_name"/>
-                               <ref object="last_name"/>
-                               <ref object="extension"/> 
-                               <ref object="user_name"/>
-                               <ref object="hired"/> 
-                               <ref object="hours"/>
-                               <ref object="editor"/>
-                       </list>
-               </property>
-       </object>  
-
-  <object id="entry_save_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="entry_save" />
-               </property>
-  </object>
-
+                       
   <object id="entry_save" type="PhoneBook.Core.Commands.BaseSave, 
PhoneBook.Core">
                <property name="ID">
                        <value>entry_save</value>
@@ -176,10 +123,4 @@
                </property>
        </object>
 
-  <object id="directory_entry_helper" parent="BaseHelper" singleton="false">
-               <property name="Command">
-                       <ref object="entry" />
-               </property>
-  </object>
-         
 </objects>

Modified: 
struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Query/SelectAll.xml
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Query/SelectAll.xml?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Query/SelectAll.xml 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Resources/Query/SelectAll.xml 
Tue Sep 13 12:36:07 2005
@@ -68,7 +68,7 @@
                                user_name,
                                hired,
                                hours,
-                               editor
+                               editor,
                                pk_entry
                                )
                        VALUES (?,?,?,?, ?,?,?,?)

Modified: struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj?rev=280633&r1=280632&r2=280633&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj (original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Web.csproj Tue Sep 13 12:36:07 
2005
@@ -184,6 +184,22 @@
                     BuildAction = "Content"
                 />
                 <File
+                    RelPath = "Controls\AppGridControl.ascx"
+                    SubType = "UserControl"
+                    BuildAction = "Content"
+                />
+                <File
+                    RelPath = "Controls\AppGridControl.ascx.cs"
+                    DependentUpon = "AppGridControl.ascx"
+                    SubType = "ASPXCodeBehind"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Controls\AppGridControl.ascx.resx"
+                    DependentUpon = "AppGridControl.ascx.cs"
+                    BuildAction = "EmbeddedResource"
+                />
+                <File
                     RelPath = "Controls\Finder.ascx"
                     SubType = "UserControl"
                     BuildAction = "Content"
@@ -200,6 +216,22 @@
                     BuildAction = "EmbeddedResource"
                 />
                 <File
+                    RelPath = "Controls\Finder2.ascx"
+                    SubType = "UserControl"
+                    BuildAction = "Content"
+                />
+                <File
+                    RelPath = "Controls\Finder2.ascx.cs"
+                    DependentUpon = "Finder2.ascx"
+                    SubType = "ASPXCodeBehind"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Controls\Finder2.ascx.resx"
+                    DependentUpon = "Finder2.ascx.cs"
+                    BuildAction = "EmbeddedResource"
+                />
+                <File
                     RelPath = "Controls\Lister.ascx"
                     SubType = "UserControl"
                     BuildAction = "Content"
@@ -213,6 +245,22 @@
                 <File
                     RelPath = "Controls\Lister.ascx.resx"
                     DependentUpon = "Lister.ascx.cs"
+                    BuildAction = "EmbeddedResource"
+                />
+                <File
+                    RelPath = "Controls\Lister2.ascx"
+                    SubType = "UserControl"
+                    BuildAction = "Content"
+                />
+                <File
+                    RelPath = "Controls\Lister2.ascx.cs"
+                    DependentUpon = "Lister2.ascx"
+                    SubType = "ASPXCodeBehind"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Controls\Lister2.ascx.resx"
+                    DependentUpon = "Lister2.ascx.cs"
                     BuildAction = "EmbeddedResource"
                 />
                 <File

Added: struts/sandbox/trunk/overdrive/PhoneBook/prebuild.bat
URL: 
http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/PhoneBook/prebuild.bat?rev=280633&view=auto
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/prebuild.bat (added)
+++ struts/sandbox/trunk/overdrive/PhoneBook/prebuild.bat Tue Sep 13 12:36:07 
2005
@@ -0,0 +1 @@
+XCOPY %1Test\Resources\*.* %1Web\Resources\*.* /M /Y



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to