Author: husted
Date: Fri Nov 18 11:25:14 2005
New Revision: 345544

URL: http://svn.apache.org/viewcvs?rev=345544&view=rev
Log:
OVR-5
* Toggle off Add button when adding or editng.

Modified:
    struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs

Modified: 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=345544&r1=345543&r2=345544&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs 
(original)
+++ struts/sandbox/trunk/overdrive/PhoneBook/Web/Controls/Lister2.ascx.cs Fri 
Nov 18 11:25:14 2005
@@ -26,6 +26,26 @@
                /// 
                protected Button add;
 
+               /// <summary>
+               /// Toggle off the add button when adding.
+               /// </summary>
+               /// 
+               protected override void list_Add()
+               {
+                       base.list_Add();
+                       add.Visible = false;
+               }
+
+               /// <summary>
+               /// Toggle off the add button when editing.
+               /// </summary>
+               /// 
+               protected override void list_Edit(int index)
+               {
+                       base.list_Edit(index);
+                       add.Visible = false;
+               }
+
                protected override IViewHelper Save(string key, 
ControlCollection controls)
                {
                        IViewHelper h = base.Save(key, controls, false);
@@ -73,6 +93,17 @@
                }
 
                /// <summary>
+               /// Toggle add button on and present Grid.
+               /// </summary>
+               /// <returns>True if nominal</returns>
+               /// 
+               public override bool Open()
+               {
+                       add.Visible = true;
+                       return base.Open ();
+               }
+
+               /// <summary>
                /// Complete loading Grid 
                /// after other members have initialized.
                /// </summary>
@@ -83,10 +114,9 @@
                        HasEditColumn = profile.IsEditor;
                }
 
-
                private IKeyValueList _EditorKeys = null;
 
-               private IKeyValueList EditorKeys
+               private IKeyValueList EditorKeyList
                {
                        get
                        {
@@ -109,6 +139,11 @@
                /// 
                private static string LABEL = "_label";
 
+               /// <summary>
+               /// Assemble an IGridConfig for an attribute.
+               /// </summary>
+               /// <param name="dataField">The attribute ID</param>
+               /// <returns>An IGridConfig instance</returns>
                private IGridConfig GetConfig(string dataField)
                {
                        string headerText = GetMessage(dataField + LABEL);
@@ -140,8 +175,8 @@
                        list.Add(GetConfig(App.HIRED));
                        list.Add(GetConfig(App.HOURS));
                        IGridConfig c = GetConfig(App.EDITOR);
-                       c.ItemTemplate = new KeyValueTemplate(App.EDITOR, 
EditorKeys);
-                       c.EditItemTemplate = new 
DropDownListTemplate(App.EDITOR, EditorKeys);
+                       c.ItemTemplate = new KeyValueTemplate(App.EDITOR, 
EditorKeyList);
+                       c.EditItemTemplate = new 
DropDownListTemplate(App.EDITOR, EditorKeyList);
                        list.Add(c);
                        Configs = list;
                }



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

Reply via email to