Cascading dropdownlistfor fires validation on new form

13 posts, 0 answers
  1. AP
    AP avatar
    190 posts
    Member since:
    Apr 2010

    Posted 07 Sep 2016 Link to this post

    I have a grid with a pop-up edit form, with a cascading dropdown list. It works fine except that when choosing to add a new record, the form opens and the dropdown list shows the validation error message before the user has done anything.

     

    I've attached a screenshot. The definition of the dropdown lists is:-

      <p>
            <span class="fieldlabel">
                System:
            </span>
            @(Html.Kendo().DropDownListFor(m => m.system)
    .Name("system")
    .OptionLabel("Select a system")
    .DataValueField("Code")
    .DataTextField("Description")
    .DataSource(src => src.Read(rd => rd.Action("GetSystems", "Home")))
     
            )
     
            @Html.ValidationMessageFor(model => model.system)
     
    </p>
     
        <p>
            <span class="fieldlabel">
                Priority:
            </span>
            @(Html.Kendo().DropDownListFor(m => m.Priority)
    .Name("Priority")
    .OptionLabel("Select a priority")
    .DataValueField("Code")
    .DataTextField("Description")
    .DataSource(src => src.Read(rd => rd.Action("GetPriorities", "Home")))
     
            )
     
            @Html.ValidationMessageFor(model => model.Priority)
     
        </p>
     
     
        <p>
            <span class="fieldlabel">
                Sub Category:
            </span>
            @(Html.Kendo().DropDownListFor(m => m.SubCategoryCode)
    .Name("SubCategoryCode")
    .OptionLabel("Select a sub category")
    .DataValueField("Code")
    .DataTextField("Description")
    .DataSource(src => src.Read(rd => rd.Action("GetSubCategoriesbySystem", "Home").Data("filterSystems")).ServerFiltering(true))
     .Enable(false)
    .AutoBind(false)
    .CascadeFrom("system")
     
            )
     
            @Html.ValidationMessageFor(model => model.SubCategoryCode)
     
        </p>

    How can I stop this?

     

    Thanks

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 09 Sep 2016 Link to this post

    Hello Andrew,

    We have a code library that covers the cascading DropDownLists in the Grid's popup editor scenario. I tested it with version 2016.2.714 and a validation message was not displayed on popup opening, but after clicking on a DropDownList. Could you please run it, try to reproduce the behavior you are experiencing it it and attach it for further review?

    Looking forward to your reply.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. AP
    AP avatar
    190 posts
    Member since:
    Apr 2010

    Posted 09 Sep 2016 in reply to Ivan Danchev Link to this post

    Thanks for this. I got the library code to run, and it was fine. I then transferred the classes and page over to my project, and got some very strange behaviour.

    1. A record could be saved without any validation firing, if all the dropdowns were left untouched.

    2. As soon as the first drop-down was clicked, all validation messages fired (screenshot attached).

    I'm using Version 2016.2.504 of KendoUI, Version 4.5 of the .NET framework and MVC 5.

  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 12 Sep 2016 Link to this post

    Hello Andrew,

    We were able to reproduce the behavior you describe. It seems a change has been introduced to the validation logic since Q1 2016, because the validation triggers differently if version 2015.3.930 scripts are used compared to using 2016.1.112 and newer. We will need more time, in order to further investigate this inconsistency. I will get back to you as soon as we have any result.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. AP
    AP avatar
    190 posts
    Member since:
    Apr 2010

    Posted 13 Sep 2016 in reply to Ivan Danchev Link to this post

    Thanks, I look forward to hearing from you.
  6. AP
    AP avatar
    190 posts
    Member since:
    Apr 2010

    Posted 15 Sep 2016 in reply to AP Link to this post

    Does the latest 2016.3.914 still have this bug?
  7. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 15 Sep 2016 Link to this post

    Hello Andrew,

    Thank you for your patience.

    The behavior in the latest version is identical to the one in Q1 2016 and newer releases. We logged a public issue that contains more information.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 15 Sep 2016 Link to this post

    Hi Andrew,

    As a token of gratitude for your involvement in identifying this issue I updated your Telerik points.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. AP
    AP avatar
    190 posts
    Member since:
    Apr 2010

    Posted 16 Dec 2016 Link to this post

    Looking at the GitHub issues page, this issue appears to have been closed and not fixed. Is this the case?

    This is quite concerning, as this will prevent us using the latest versions of Kendo UI.

    The issue log states the behaviour is 'unintuitive', however I would say that it is just plain broken, as its not what a user expects when starting to enter a new record. 

  10. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 20 Dec 2016 Link to this post

    Hello Andrew,

    Indeed the issue has been reviewed and closed after the team decided that this is the expected behavior, as explained by ggkrustev in his comment on the issue.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  11. AP
    AP avatar
    190 posts
    Member since:
    Apr 2010

    Posted 20 Dec 2016 in reply to Ivan Danchev Link to this post

    Unfortunately, it's the expected behaviour for developers using MVVM, not users, who on going to enter a new record are immediately faced with validation warnings.

    The suggested workaround of using nullable fields removes the point of validation (which in the case of a drop-down lists is to ensure a value is selected).

    Cascading drop-down lists worked well until the 2016 release, and now are unusable. I would urge you to think again, and revisit this behaviour, as at the moment there is no point upgrading or starting development on new projects using any version of Kendo UI later than 2015 Q3.

    At the very least, is it possible for you to provide details on how to remove the MVVM functionality that's causing the problem from later versions, so I can keep up to date, but keep using cascading drop-downs.

  12. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 22 Dec 2016 Link to this post

    Hello Andrew,

    We appreciate your feedback. I forwarded it to the dev team along with your inquiry on the MVVM functionality and will get back to you as soon as I receive any new information.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  13. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1056 posts

    Posted 23 Dec 2016 Link to this post

    Hello Andrew,

    I received a word from our developers and a change in the way validation is triggered currently is not planned.
    Thus the options for keeping the old behavior are:
    • you can use the Kendo UI version that has the desired behavior and not upgrade to a newer version
    • you can modify the relevant code, in order to achieve the expected behavior
    • you can create your own implementation of DropDownList cascade different from the built-in one
    As for your last question, explanation on code implementation or guidance on modifying or overriding the source code falls outside the support service scope as explained in the Product Guidance section of the Scope of Support page. We can suggest logging a discussion on the desired functionality/expected behavior in the User Voice portal. This would allow other members of the community to get involved and share their opinion on the matter.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top