チェンジセット 1641 (default)


以下の違いを無視:
日時:
2024/03/12 10:38:13 (7ヵ月前)
更新者:
hizuya@…
ログメッセージ:
  • ErrorMessageFormatString で使用する一部の値のみをバインドした場合に正しいエラーメッセージが生成されない問題を修正。
場所:
framework/trunk
ファイル:
3個の追加
4個の更新

凡例:

未変更
追加
削除
  • framework/trunk/WebApplication/UI/WebControls/CompareValidatorPage.aspx

    r1632 r1641  
    7878                            <sff:CompareValidator runat="server" 
    7979                                ControlToValidate="TextBox301" 
     80                                ValueToCompare='<%# Eval("MaxValue") %>' 
     81                                Type="Integer" 
     82                                Operator="LessThan" 
     83                                Text="CompareValidator-Text-301-A" 
     84                                ErrorMessageFormatString="CompareValidator-ErrorMessageFormatString-301-A,2=[{2}]" 
     85                                ValidationGroup='<%# "ValidationGroup301-" + Eval("Key") %>'/> 
     86                            <sff:CompareValidator runat="server" 
     87                                ControlToValidate="TextBox301" 
    8088                                ControlNameToValidate='<%# "CompareValidator-ControlNameToValidate-301-" + Eval("Key") %>' 
    8189                                CompareNameToValidate='<%# "CompareValidator-CompareNameToValidate-301-" + Eval("Key") %>' 
     
    8391                                Type="Integer" 
    8492                                Operator="LessThan" 
    85                                 Text="CompareValidator-Text-301" 
    86                                 ErrorMessageFormatString="CompareValidator-ErrorMessageFormatString-301,0=[{0}],1=[{1}],2=[{2}]" 
     93                                Text="CompareValidator-Text-301-B" 
     94                                ErrorMessageFormatString="CompareValidator-ErrorMessageFormatString-301-B,0=[{0}],1=[{1}],2=[{2}]" 
    8795                                ValidationGroup='<%# "ValidationGroup301-" + Eval("Key") %>'/> 
    8896                            <asp:Button runat="server" 
  • framework/trunk/WebApplication/WebApplication.csproj

    r1635 r1641  
    7373    <Content Include="UI\WebControls\FormViewPage.aspx" /> 
    7474    <Content Include="UI\WebControls\RadioButtonFieldPage.aspx" /> 
     75    <Content Include="UI\WebControls\RangeValidatorPage.aspx" /> 
    7576    <Content Include="UI\WebControls\TemplateFieldPage.aspx" /> 
    7677    <Content Include="UI\WebControls\ObjectDataSourceGridViewPage.aspx" /> 
     
    355356    <Compile Include="UI\WebControls\RadioButtonFieldPage.aspx.designer.cs"> 
    356357      <DependentUpon>RadioButtonFieldPage.aspx</DependentUpon> 
     358    </Compile> 
     359    <Compile Include="UI\WebControls\RangeValidatorPage.aspx.cs"> 
     360      <DependentUpon>RangeValidatorPage.aspx</DependentUpon> 
     361      <SubType>ASPXCodeBehind</SubType> 
     362    </Compile> 
     363    <Compile Include="UI\WebControls\RangeValidatorPage.aspx.designer.cs"> 
     364      <DependentUpon>RangeValidatorPage.aspx</DependentUpon> 
    357365    </Compile> 
    358366    <Compile Include="UI\WebControls\TemplateFieldPage.aspx.cs"> 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/CompareValidator.cs

    r1631 r1641  
    6464 
    6565        /// <summary> 
     66        /// エラーメッセージを生成したときに使用した <see cref="System.Web.UI.WebControls.CompareValidator.ValueToCompare"/> の値。 
     67        /// </summary> 
     68        private string currentValueToCompare; 
     69 
     70        /// <summary> 
    6671        /// <see cref="Control.PreRender"/> に到達しているかどうか。 
    6772        /// </summary> 
     
    114119        /// このプロパティが設定されると、このプロパティ値をフォーマット文字列として 
    115120        /// <c>{0}</c> に <see cref="ControlNameToValidate"/>、 
    116         /// <c>{1}</c> に <see cref="CompareNameToValidate"/> 
     121        /// <c>{1}</c> に <see cref="CompareNameToValidate"/>、 
     122        /// <c>{2}</c> に <see cref="System.Web.UI.WebControls.CompareValidator.ValueToCompare"/> 
    117123        /// が埋め込まれた値が 
    118124        /// <see cref="System.Web.UI.WebControls.BaseValidator.ErrorMessage"/> が設定されます。 
     
    314320        protected virtual void EnsureErrorMessage() 
    315321        { 
    316             if (!RequiresErrorMessage) 
     322            if (!RequiresErrorMessage 
     323                && Equals(currentValueToCompare, ValueToCompare)) 
    317324            { 
    318325                return; 
     
    335342            } 
    336343 
     344            string valueToCompare = ValueToCompare; 
    337345            ErrorMessage 
    338346                = Utility.Format( 
     
    340348                    ControlNameToValidate, 
    341349                    CompareNameToValidate, 
    342                     ValueToCompare); 
     350                    valueToCompare); 
    343351 
    344352            RequiresErrorMessage = false; 
     353            currentValueToCompare = valueToCompare; 
    345354        } 
    346355    } 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/RangeValidator.cs

    r1622 r1641  
    5858 
    5959        /// <summary> 
     60        /// エラーメッセージを生成したときに使用した <see cref="System.Web.UI.WebControls.RangeValidator.MinimumValue"/> の値。 
     61        /// </summary> 
     62        private string currentMinimumValue; 
     63 
     64        /// <summary> 
     65        /// エラーメッセージを生成したときに使用した <see cref="System.Web.UI.WebControls.RangeValidator.MaximumValue"/> の値。 
     66        /// </summary> 
     67        private string currentMaximumValue; 
     68 
     69        /// <summary> 
    6070        /// <see cref="Control.PreRender"/> に到達しているかどうか。 
    6171        /// </summary> 
     
    278288        protected virtual void EnsureErrorMessage() 
    279289        { 
    280             if (!RequiresErrorMessage) 
     290            if (!RequiresErrorMessage 
     291                && Equals(currentMinimumValue, MinimumValue) 
     292                && Equals(currentMaximumValue, MaximumValue)) 
    281293            { 
    282294                return; 
     
    299311            } 
    300312 
     313            string minimumValue = MinimumValue; 
     314            string maximumValue = MaximumValue; 
    301315            ErrorMessage 
    302316                = Utility.Format( 
    303317                    format, 
    304318                    ControlNameToValidate, 
    305                     MinimumValue, 
    306                     MaximumValue); 
     319                    minimumValue, 
     320                    maximumValue); 
    307321 
    308322            RequiresErrorMessage = false; 
     323            currentMinimumValue = minimumValue; 
     324            currentMaximumValue = maximumValue; 
    309325        } 
    310326    } 
詳しい使い方は TracChangeset を参照してください。