Validator Callout doesn't work on RadDatePicker

4 posts, 0 answers
  1. Craig Nicholson
    Craig Nicholson avatar
    4 posts
    Member since:
    Jun 2008

    Posted 31 Aug 2008 Link to this post

    Hi, I hope you can help with this one.

    I have implemeted a RadDatePicker alongside a number of bog standard ASP.NET text boxes. On each of these I have hooked up a required field validator and validator callout extender which fire on a button click.

    If I leave the boxes empty, the validators sucessfully fire and identify which fields are not populated including the DatePicker. The callout is displayed on the first text box that is invalid. All good so far.

    However when I tab between the boxes, the callout moves from box to box for the text boxes but doesn't display at all for the RadDatePicker inputs. Basically any time you give the date picker input focus, the validator call out doesn't display. This gives a really inconsistent feel for validation.

    I'm using v.2008.01.0619.20 of the Telerik.Web.UI dll

    This appears to be a problem that is specific to the Input control, not the date picker. RadNumericTextBox seems to have the same problem.

    Any ideas?

    Regards,
    Glyn.

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Sep 2008 Link to this post

    Hi Craig,

    I tried to reproduce this however everything worked fine in my example (attached). The date-picker is populated initially with current date and if you delete this entry and try to tab the validator callout extender will work as expected..

    Best wishes,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Craig Nicholson
    Craig Nicholson avatar
    4 posts
    Member since:
    Jun 2008

    Posted 04 Sep 2008 Link to this post

    Hi Vlad,

    Thanks for getting back to me on this one. I agreed that the validator extender does work in some scenarios like the one you attached. The problem I described is when the RadInput is not the first input control that fails validation.

    I have taken your example and extended to show what the problem is. Replace your default.aspx with this code. Scenario information is written in the default.aspx. Hope this will help.

    <%@ Page Language="C#" %> 
     
    <%@ Register TagPrefix="ajaxToolkit" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> 
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <script runat="server"
     
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsPostBack) 
            { 
                //RadDatePicker1.SelectedDate = DateTime.Now; 
                //RadDatePicker1.Focus(); 
            } 
        } 
    </script> 
     
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title></title
    </head> 
    <body> 
        <form id="form1" runat="server"
        <div> 
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            Scenario: <br /> 
            Step 1 - Blank entry screen presented. Click Save. Validators fire, First Name validator extender shows. <br /> 
            Step 2 - Enter some text into first name. Tab to surname. Note: validator extender moves to surname as expected. <br /> 
            Step 3 - Enter some data into surname. Tab to date. Note: validator extender does NOT move to date picker. <br /> 
            This scenario also extends to other RadInput based controls like RadNumericTextBox. <br /><br /> 
             
            <br /> 
            Enter First name: 
            <br /> 
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="TextBox1" 
                ErrorMessage="*" EnableClientScript="true" runat="server" ValidationGroup="Save"></asp:RequiredFieldValidator> 
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2" 
                TargetControlID="RequiredFieldValidator2" /> 
            <br /> 
            Enter Surname: 
            <br /> 
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="TextBox2" 
                ErrorMessage="*" EnableClientScript="true" runat="server" ValidationGroup="Save"></asp:RequiredFieldValidator> 
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3" 
                TargetControlID="RequiredFieldValidator3" /> 
            <br /> 
            Pick a date: 
            <br /> 
            <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
            </telerik:RadDatePicker> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="RadDatePicker1" 
                ErrorMessage="*" EnableClientScript="true" runat="server" ValidationGroup="Save"></asp:RequiredFieldValidator> 
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1" 
                TargetControlID="RequiredFieldValidator1" /> 
            <br /> 
            <br /> 
            <asp:Button ID="Button1" runat="server" Text="Save" ValidationGroup="Save" /> 
        </div> 
        </form> 
    </body> 
    </html> 
     


    Regards
    Glyn

  4. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 09 Sep 2008 Link to this post

    Hi Craig,

    Indeed you are right in your observation but I'm happy to inform you that our developers has addressed this issue. I'm attaching the latest internal build (for a dev version of the build please submit a formal support ticket) to this forum post to try it out.

    Best regards,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top