GWT Editors: How to record changes to fields and sub-editors? (RequestFactory?) -


I have an app that uses widespread editorial framework right now I am at a point where I want to add a new feature : If a user edits an entity, I want to record which changes were made and submit them to a separate datastore unit. It needs to know that a field was changed, the name of the field, and its value was changed.

This is what I want to apply:

  1. App calls
  2. User changes, flashes () and data Is sent back to the server.
  3. In the server handler, changes in beans are sent to the process (list & lt; string & gt; path) which again creates records and records that " Field foo "was changed to" bar ", and so on.
  4. The unit has been saved, overwriting the existing one.

I use GWTP and currently use RPC command pattern. I have read something about RequestFactory and as I understand, one of the main advantages is that it only reduces the payload to return to the server as "deltas" Sends, why would I have to use RequestFactory to have a better fit for my app?

Forgiveness - I am reading through the editor framework and GWT Docs and Jawadox for the request, but I am still very confused. It seems like this can happen to me, but any advice or hint greatly appreciates.

I might look for a change in client-side but it seems like a bad idea.

I believe that you can do that, which is the DirtCollector Is similar to the editor, used internally by the editor framework to collect paths in Visitors on PathCollector ).

After the call I started to collect the initial value edit () (it is done internally by DirtCollector , but There is no way to reach its consequences, and it collects only leaf values ​​ anyway).
Then you can say to flush () ans that there are errors, and possibly to verify that everything is fine then you can then collect changes From the hierarchy (with the initial values ​​you had collected before) so that you can send them to the server.


Comments