This is a migrated thread and some comments may be shown as answers.

Problem with TelerikDateInput using version 1.2.0

4 Answers 144 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kenny
Top achievements
Rank 2
Kenny asked on 21 Jun 2019, 08:32 PM

 

I am getting the following exception when I load a page with the DateInput widget on it:

Microsoft.AspNetCore.Components.Server.ComponentHub: Warning: Unhandled Server-Side exception

Microsoft.JSInterop.JSException: this.element.addEventListener is not a function
TypeError: this.element.addEventListener is not a function
    at t.value (https://kendo.cdn.telerik.com/blazor/1.0.0/telerik-blazor.min.js:1:3367)
    at new t (https://kendo.cdn.telerik.com/blazor/1.0.0/telerik-blazor.min.js:1:2735)
    at initialize (https://kendo.cdn.telerik.com/blazor/1.0.0/telerik-blazor.min.js:1:2169)
    at https://localhost:44329/_framework/blazor.server.js:8:21434
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:44329/_framework/blazor.server.js:8:21403)
    at https://localhost:44329/_framework/blazor.server.js:1:16653
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:44329/_framework/blazor.server.js:1:16624)
    at e.processIncomingData (https://localhost:44329/_framework/blazor.server.js:1:14624)
   at Telerik.Blazor.Components.DateInput.TelerikDateInputBase`1.OnAfterRender()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

 

 

Here is a simple example page taken and simplified from the demo source code that reproduces the problem:

@page "/Tests"

@using Telerik.Blazor.Components.DateInput

    <strong> Hire Date</strong>
    <TelerikDateInput @bind-Value="HireDate" Format="MMMM/dd/yyyy"></TelerikDateInput>

@code  {
    DateTime HireDate = new DateTime(2018, 5, 6);
}

I tried it with an ampersand in front of HireDate as it was in the demo code sample like so and got the same results:
      <TelerikDateInput @bind-Value="@HireDate" Format="MMMM/dd/yyyy"></TelerikDateInput>

 

Thanks,

Kenny

4 Answers, 1 is accepted

Sort by
0
Kenny
Top achievements
Rank 2
answered on 21 Jun 2019, 09:04 PM
I forgot to mention, this "kills" the events on the page.  No clicks or other JavaScript events work after this exception.
0
Accepted
Rick
Top achievements
Rank 1
Veteran
answered on 22 Jun 2019, 01:04 AM
Did you remember to update the Telerik javascript reference to the latest version when you upgraded? In your host.cshtml file?
0
Kenny
Top achievements
Rank 2
answered on 22 Jun 2019, 04:43 PM
Nope, I forgot that part.  That was it!  Thanks Rick.
0
Marin Bratanov
Telerik team
answered on 24 Jun 2019, 10:53 AM
Hi guys,

It's good to see you have resolved this, and thank you for helping out, Rick.

I'd like to chime in with two bits of trivia that may be useful (for someone else too):

 


Regards,
Marin Bratanov
Progress Telerik UI for Blazor
Tags
General Discussions
Asked by
Kenny
Top achievements
Rank 2
Answers by
Kenny
Top achievements
Rank 2
Rick
Top achievements
Rank 1
Veteran
Marin Bratanov
Telerik team
Share this question
or