that is the code generated for a generic application. Is what makes sense for a generic application.
But this is part of your application and you can tailor/change as it better fits to your need. This is even the main beauty of the Rhodes/RhoElements framework: the flexibility.
Other things that you may want to change is in the Settings controller for:
- What happens when a sync is complete, default is to go to start page
- What happens when there's an error during sync, on create error, default for v2.2SP1 is to delete the record, to avoid that invalid records freeze the sync process.
- What happens during sync, want to show a spinning wheel or a progress bar? again in the sync_notify action in the Settings controller, there're the hooks to do this.
and so on.
If there's something that doesn't fit with your design, you can change it!
In your case, you want probably to change what happens in the sync_notify action in the Settings controller.
Alexey, here are some other pointers you may find useful:
- in app/application.rb you will see that sync engine notifications are being sent to /app/Settings/sync_notify. You can change that to point to your own controller if you want, or modify the sync_notify action in the Settings controller to do what you need
- it is not necessary to logout after synchronizing (unless you have a good reason to do so). Also, when dosync() returns the sync process will not be complete yet because synchronization is a background process, if you logout immediately after dosync(), it is likely that synchronization will never complete successfully.
- redirect does not work in callbacks, you must use WebView.navigate instead
Thenk Kutir. It help me. Can I sync onle one ore two models only what i need (not evry model)?
1 of 1 people found this helpful
Yes, you can either use dosync to synchronize everything or dosync_source to synchronize only a particular model