チェンジセット 1652 (default)
- 日時:
- 2024/06/23 17:46:46 (3ヵ月前)
- 場所:
- framework/trunk
- ファイル:
-
- 4個の更新
凡例:
- 未変更
- 追加
- 削除
-
framework/trunk/WebApplication/UI/WebControls/SelectFieldTemplatePage.aspx
r1651 r1652 50 50 [ <asp:CheckBox runat="server"/> ] 51 51 </asp:PlaceHolder> 52 <asp:PlaceHolder runat="server" 53 Visible='<%# !(bool)Eval("is_small") %>'> 54 x <asp:CheckBox runat="server"/> x 55 </asp:PlaceHolder> 52 56 </ItemTemplate> 53 57 </sff:SelectField> … … 71 75 </sff:GridView> 72 76 </div> 77 <div> 78 Selected: <asp:Literal runat="server" ID="Literal101"/> 79 </div> 73 80 74 81 </div> -
framework/trunk/WebApplication/UI/WebControls/SelectFieldTemplatePage.aspx.cs
r1651 r1652 24 24 { 25 25 using System; 26 using System.Collections.Generic; 26 27 using System.Web.UI.WebControls; 27 28 using FCSoft.SilverFrost.Framework.ComponentModel; … … 68 69 protected void PostBackButton_OnClick(object sender, EventArgs e) 69 70 { 71 List<string> selectedDataKeyValues = new List<string>(); 70 72 foreach (DataKey dataKey in CommonDbDataSource101GridView.SelectedDataKeys) 71 73 { 72 74 Logger.Debug(90001, "Selected: '{0}'", dataKey.Value); 75 selectedDataKeyValues.Add((string)dataKey.Value); 73 76 } 74 77 … … 83 86 selectFieldIndex++; 84 87 } 88 89 Literal101.Text = string.Join(", ", selectedDataKeyValues.ToArray()); 85 90 } 86 91 } -
framework/trunk/WebApplication/UI/WebControls/SelectFieldTemplatePage.aspx.designer.cs
r1651 r1652 48 48 /// </remarks> 49 49 protected global::FCSoft.SilverFrost.Framework.Web.UI.WebControls.GridView CommonDbDataSource101GridView; 50 51 /// <summary> 52 /// Literal101 コントロール。 53 /// </summary> 54 /// <remarks> 55 /// 自動生成されたフィールド。 56 /// 変更するには、フィールドの宣言をデザイナー ファイルから分離コード ファイルに移動します。 57 /// </remarks> 58 protected global::System.Web.UI.WebControls.Literal Literal101; 50 59 } 51 60 } -
framework/trunk/WebLibrary/Sources/UI/WebControls/SelectField.cs
r1651 r1652 569 569 570 570 571 // FIXME Reflections に移す 572 571 573 /// <summary> 572 574 /// <see cref="RadioButtonIdSeparatorAccessor"/> フィールドの値を取得します。 … … 675 677 private static ICheckBoxControl FindCheckBoxControl(ControlCollection controls, bool visibleOnly) 676 678 { 679 bool isVisible; 680 ICheckBoxControl checkBoxControl = FindCheckBoxControl(controls, out isVisible); 681 return !visibleOnly || isVisible 682 ? checkBoxControl 683 : null; 684 } 685 686 /// <summary> 687 /// コントロールコレクションから最初に見付かった <see cref="ICheckBoxControl"/> を返します。 688 /// </summary> 689 /// <param name="controls">コントロールコレクション。</param> 690 /// <param name="isVisible"> 691 /// <see cref="ICheckBoxControl"/> が見付かった場合で表示中の場合は <see langword="true"/>。 692 /// それ以外の場合は <see langword="false"/>。 693 /// </param> 694 /// <returns> 695 /// コントロールコレクションから最初に見付かった <see cref="ICheckBoxControl"/>。 696 /// 存在しない場合は <see langword="null"/>。 697 /// </returns> 698 private static ICheckBoxControl FindCheckBoxControl(ControlCollection controls, out bool isVisible) 699 { 677 700 if (controls == null || controls.Count == 0) 678 701 { 702 isVisible = false; 679 703 return null; 680 704 } … … 682 706 foreach (Control control in controls) 683 707 { 684 // 非表示の場合は無視 685 if (visibleOnly && !control.Visible) 686 { 687 continue; 688 } 689 690 ICheckBoxControl checkBoxControl 691 = control as ICheckBoxControl 692 ?? FindCheckBoxControl(control.Controls, visibleOnly); 708 // ICheckBoxControl の場合 709 ICheckBoxControl checkBoxControl = control as ICheckBoxControl; 693 710 if (checkBoxControl != null) 694 711 { 712 isVisible = control.Visible; 695 713 return checkBoxControl; 696 714 } 697 } 698 715 716 // 子孫に ICheckBoxControl を持つ場合 717 bool childIsVisible; 718 checkBoxControl = FindCheckBoxControl(control.Controls, out childIsVisible); 719 if (checkBoxControl != null) 720 { 721 isVisible = childIsVisible && control.Visible; 722 return checkBoxControl; 723 } 724 } 725 726 isVisible = false; 699 727 return null; 700 728 }
※ 詳しい使い方は
TracChangeset を参照してください。