PDA

View Full Version : Chat application with EXT



Z
Oct 28, 2020, 6:58 AM
We need to add a chat application to our web app. Do you have an example that would show the best way to do this? In the past, i have seen examples using SIGNALR but those are very old. The key is for the webapp to update the UI when a new message is received without "refreshing"

thanks!
/Z

geoffrey.mcgill
Oct 28, 2020, 7:45 PM
We don't have a Chat sample, but this would certainly be nice to have. I have wanted to create a Chat component for a long time.

I would likely still use SignalR though.

We don't have the resources available to build a Chat component right now, but I will bump the priority and we can post an update to this thread if a component is released. It would be Ext.NET Classic only though.

fabricio.murta
Oct 28, 2020, 7:48 PM
Hello @Z!

Complementing Geoffrey response above, focusing in Ext.NET 5:

We have an example that currently works using SignalR at SignalR > Basic > Stock Ticker (https://examples5.ext.net/#/SignalR/Basic/StockTicker/). You may use that for reference.

But we don't really have any example to this specific use case. Ext.NET currently supports appending components within containers, so you can just create your own "chat baloon" component and keep appending it as new messages come. And maybe remove very old message baloons if the chat history tends to get long.

As for checking for new messages without full a page reload you can either make asynchronous ajax requests to the server from time to time, use SignalR as the example above, or implement a solution to that using Web Sockets (if you want to avoid SignalR API for Web Sockets). Web sockets is still a current technology and I see it has support for it in ASP.NET Core (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/websockets?view=aspnetcore-3.1), including SignalR API itself. So it feels safe to rely on the technology for nowadays applications.

As long as you can host .NET Framework 4.5+ websites, you can use Web Sockets (and SignalR). If you want support to very old .NET framework, you may be able to employ an external WebSockets server, or just employ stateless asynchronous ajax requests just to fetch new messages in the running chat session.

If you start something in one or another approaches and get stuck with Ext.NET communicatiuon, we may try to help you, so if you start on very simple chat app (like, just something that fetches current date/time every time interval) to share as test case may help.

Hope this helps!