How to update a CellTable dynamically using GWT - gwt

Working on a GWT app that uses a CellTable to display data. I was wondering if it was possible to update this CellTable dynamically when data from the database has changed(without a specific button). Maybe each 2 seconds or something like that.
I looked for a while and I'm... :
onRangeChanged(AsyncDataProvider) is fired only when the user modify the table. right?
So, am I obliged to implement a solution which uses WebSocket like Atmosphere or gwtEventService? or is there an other way?
Thanks

Yes you are right, there is nothing in gwt which links the table with the server side out-of-the-box.
Maybe someday RequestFactory could have a comet server push mechanism so as entities are notified when there are server changes.
So the solution right now is to configure an AsyncDataProvider for your table and use some server push library like you point (I use gwt-atmosphere) to fire an event whenever the data is modified so as the data provider could update the table.

This guide should help, GWT has a built in way of doing this through a DataProvider. There is even a specific AsyncDataProvider class.

Related

Using ag-grid groupRemoveSingleChildren with SSRM

I'm using ag-grid with server-side mode for retrieving data from the backend. I would like to use groupRemoveSingleChildren option so there would be no need to expand if only one row available. However I'm wondering if it's even possible for non client-side model, how would it suppose to know that only one row available? I've tried to use getChildCount() but it doesn't seem to be related. Thanks in advance

Linking a form to backend API on AppDrag

So I started working on this CMS called AppDrag, (it's kinda like a Squarespace but for developers, where you like have access to the source code of all your elements) has anyone used it yet? I'm a bit stuck trying to figure out how to make a form call an API from my backend. I dragged an input field into my page and it doesn't give me the option to trigger it to my APIs.
I also had a hard time with that at first. You actually have to make sure you're dragging in a Cloud Backend Input, and not a standard Form Input. Then in your triggers, select Cloud Backend, and make sure to check "Enable".

Handling Browser Refresh in GWT

I am new ta GWT and I would like to know if there is a way to handler browser refresh. What happens now is that each time a user refreshes the page, or click F5, the application returns the user to the login page. what I want is to have the user stay at the same page when the page is refreshed. An example would be perfect.
Thanks a lot in advance!
Take a look at the Activities and Places design pattern for GWT.
It is a highly recommended approach that can handle page refreshes as well as back and forward buttons, and allows users to bookmark "pages" within your app.
Along with looking at activities and places which is a very useful way of handling navigation in an ajax application you will also need to handle the session from the server. You would have a call to do authentication either through a realm or some kind of homegrown authentication. I recommend Apache Shiro if you are just getting started. When you application loads from a refresh you need to make a call to the server to validate that the session you have is still valid and if so, you would send the user to the correct Place/Activity. The Activity/Places is a little bit more boiler plate but it is worth it in the long run and makes the application much more flexible. You may also want to checkout Arcbees GWTP plugin. This will handle most of the boilerplate for you but beware it can be a little complex to a newby. It uses Gin for dependecy injection and has some custom place mapping things that are a little different. But overall the documentation is very good and the gwtp eclipse plugin can save you some copying and pasting for some things.
You should look at the GWTP car store example. They did what you are looking for. https://github.com/ArcBees/GWTP/tree/master/gwtp-carstore
I would recommend you to consider History Tokens in your development to handle adhoc F5 refresh problems. Please have a look at http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html. While changing from one screen/layout to other, History Tokens help your browser keep track of the changes, because History Tokens change the URL itself. Examples can be found in the shared link.

Looking for a “light” gwt framework with a rich-featured grid

I'm looking for a gwt framework with a grid that can handle more than 500.000 rows and has features like filtering, sorting, basic events (click, double-click), multi selection, auto save, bulk save, etc. I was looking at sencha and smartGWT, but they seem a bit heavy.
Could you recommend anything?
tia
Have a look on PWT, we built this framework to be as lightweight as possible.
All the features that you need are almost availabe.
But to be honest, I'am not sure that you must edit 500 000 rows on a single page, A so huge amount of data will cause memory and performance issues.
You can see the TableEditor on the sample Contacts Table : http://pwt.putnami.org/#!ContactsTable
Regards.
You can use pure GWT for your app. Here is an example of a DataGrid widget:
http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwDataGrid
Note that there is no need to load all data into the browser. You can use an asynchronous data provider and offer different filtering, sorting, search, etc. options to your users. And you always show only the first 20/50/100 results to a user.

How to send list grid data to email using GWT

can anyone suggest how to send grid data to email(compose email) using smart gwt/GXT.because i am smart gwt beginer
I believe you'll want to take the data in the ListGrid's DataSource and POST it to another handler to accomplish what you'd like to do. I don't think SmartGWT itself will provide the functionality you're looking for.