ListView Server-Side Validation

2 posts, 0 answers
  1. Aaron
    Aaron avatar
    1 posts
    Member since:
    Feb 2016

    Posted 10 Jan 2017 Link to this post

    I currently have a ListView that I'm using to update database entries.  I'm not getting any of the ModelState errors to display upon update.  This is my main issue.

    After reviewing the related tickets here, the solution seemed fairly simply.  However, I'm having some issues, here is my ListView

                        .DataSource(dataSource => dataSource
                            .Model(model => model.Id(p => p.OrderID))
                            .Read(read => read.Action("ProductReadAll", "Order", new { associatedOrderID =       ViewBag.AssociatedOrderID }))
                            .Create(create => create.Action("ProductCreate", "OpsOrder"))
                            .Update(update => update.Action("ProductUpdate", "OpsOrder"))
                            .Events(e => e.Error("error"))
                        .Editable(edit => edit.TemplateName("ProductEdit"))

    My issue with this, adding the Error Event is causing an error stating that "error" (the name of whatever js function I use) is not defined in /Order/ProductDetailsRead.  ProductDetailsRead is a method in my controller that is called to show the page this ListView is on.  Why is the ListView looking in my controller for a js function?  Haven't run into anything similar to this anywhere else in our website.

    Are there any alternatives to showing modelstate errors when updating an item? Something more similar to grids?






  2. Angel Petrov
    Angel Petrov avatar
    1153 posts

    Posted 12 Jan 2017 Link to this post


    I am experiencing difficulties understanding the scenario. Is the ListView not finding the controller action that should be used for updating? In order for us to provide a precise answer on the matter I suggest sharing with us the entire view and controller code. If this is not possible I would kindly like to ask you to open a formal support ticket and attach a small runnable sample that we can debug.

    Angel Petrov
    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