Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
Pushed to 2 repositories · View In Graph Contained in tip and canonical

Removed FormThirdColCheckBoxesToFourthColCellsDisplayLink, which was obsolete.

Changeset 82966b189973

Parent 188bb9fb525d

by Profile picture of William GrossWilliam Gross

Changes to 2 files · Browse files at 82966b189973 Showing diff from parent 188bb9fb525d Diff from another changeset...

Change 1 of 1 Show Entire File Core/​Core.csproj Stacked
 
321
322
323
324
325
326
327
 
321
322
323
 
324
325
326
@@ -321,7 +321,6 @@
  <Compile Include="EnterpriseWebFramework\Component Display\DisplayLinking\CheckBoxToControlArrayDisplayLink.cs" />   <Compile Include="EnterpriseWebFramework\Component Display\DisplayLinking\DisplayLink.cs" />   <Compile Include="EnterpriseWebFramework\Component Display\DisplayLinking\DisplayLinkingOps.cs" /> - <Compile Include="EnterpriseWebFramework\Component Display\DisplayLinking\FormThirdColCheckBoxesToFourthColCellsDisplayLink.cs" />   <Compile Include="EnterpriseWebFramework\Component Display\DisplaySetup.cs" />   <Compile Include="EnterpriseWebFramework\Core\AccessDeniedException.cs" />   <Compile Include="EnterpriseWebFramework\Core\AppMetaLogicFactory.cs" />
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,76 +0,0 @@
-using System.Linq; -using System.Web.UI; -using System.Web.UI.WebControls; -using EnterpriseWebLibrary.EnterpriseWebFramework.Controls; - -namespace EnterpriseWebLibrary.EnterpriseWebFramework.DisplayLinking { - /// <summary> - /// A mapping between all check boxes in the third column of a form and all subsequent cells to the right of those checkboxes. When a check box is checked, the cells will be visible. - /// </summary> - public class FormThirdColCheckBoxesToFourthColCellsDisplayLink: DisplayLink { - /// <summary> - /// Creates a new display link and adds it to the current EwfPage. - /// </summary> - public static void AddToPage( Panel form ) { - EwfPage.Instance.AddDisplayLink( new FormThirdColCheckBoxesToFourthColCellsDisplayLink( form ) ); - } - - private readonly Panel form; - - private FormThirdColCheckBoxesToFourthColCellsDisplayLink( Panel form ) { - this.form = form; - } - - void DisplayLink.AddJavaScript() { - linkThirdColCheckBoxesToFourthColCellsDisplay( null ); - } - - void DisplayLink.SetInitialDisplay( PostBackValueDictionary formControlValues ) { - linkThirdColCheckBoxesToFourthColCellsDisplay( formControlValues ); - } - - private void linkThirdColCheckBoxesToFourthColCellsDisplay( PostBackValueDictionary formControlValues ) { - foreach( Control formChild in form.Controls ) { - var panelIndex = 0; - foreach( Control rowChild in formChild.Controls ) { - if( rowChild is Panel ) { - panelIndex += 1; - if( panelIndex == 3 ) { - linkFirstPanelCheckBoxToNextPanelDisplay( formControlValues, rowChild ); - break; - } - } - } - } - } - - private static void linkFirstPanelCheckBoxToNextPanelDisplay( PostBackValueDictionary formControlValues, Control outerPanel ) { - var panelIndex = 0; - BlockCheckBox checkBox = null; - Panel panel = null; - foreach( var control in outerPanel.Controls.OfType<Panel>() ) { - panelIndex += 1; - if( panelIndex == 1 ) - checkBox = getFirstCheckBox( control ); - else if( panelIndex == 2 ) - panel = control; - } - if( checkBox != null && panel != null ) { - if( formControlValues == null ) - DisplayLinkingOps.AddDisplayJavaScriptToCheckBox( checkBox, true, panel ); - else - DisplayLinkingOps.SetControlDisplay( panel, checkBox.IsCheckedInPostBack( formControlValues ) ); - } - } - - private static BlockCheckBox getFirstCheckBox( Control parent ) { - foreach( Control child in parent.Controls ) { - if( child is EwfCheckBox ) - return child as BlockCheckBox; - else if( getFirstCheckBox( child ) != null ) - return getFirstCheckBox( child ); - } - return null; - } - } -} \ No newline at end of file