Current filter:
                                You should refresh the page.
                                  • > imagine the following scenario:
                                    > 1) the user clicks on a SimpleAction-button
                                    > 2) the application does some heavy calculation in the OnExecute-event
                                    > 3) after some time, the calculation is done and the user shall see a
                                    > confirmation-message, that everything was going right.
                                    I guess that you take into account that the process should be asynchronous and should be visualized in some way (for example, with a progress bar), in other words the end-user may work with other parts of the application during a heavy calculation process, watch the process status and he will be notified about the process completion.
                                    In short, the answer is "No, we don't have a ready-to-use solution for this scenario for both Win- and Web-applications"
                                    Thanks, we'll consider your ideas and see how they can be incorporated into our plans.

                                1 Solution

                                Creation Date Importance Sort by

                                In XAF, you can implement standard solutions available in .NET Framework for such scenarios. At the moment we have following XAF integration examples collected here for more convenience of XAF customers who require the same thing.

                                Core
                                XAF ships with asynchronous method support in IObjectSpace in v19.2. To learn more about the new IObjectSpaceAsyncinteface and custom async operations in WinForms apps, please read this knowledge base article and respond to a few questions from the R&D team. This will help shape future development plans - asynchronous operations within standard XAF WinForms and Blazor UI modules.

                                WinForms:
                                In the simplest case, you can consider using a DevExpress Splash Form, as described in the Manage Splash Forms in an Application topic. There may be alternative solutions using Controllers like shown by Oleg Krupenkin in T381107 or as it is implemented in the standard XAF WaitCursorController class (the default mouse pointer is turned into a clock).
                                If you would like to update the main form status bar with the progress information, check out the eXpressApp Framework > Task-Based Help > How to: Customize Window Status Messages article as well as the T474178 ticket.
                                Finally, research the LongOperationController, ProgressForm and related classes in our FeatureCenter demo (C:\Users\Public\Documents\DevExpress Demos 1X.X\Components\eXpressApp Framework\FeatureCenter\CS\FeatureCenter.Module\LongOperationController.cs) to see how a fully custom progress form functionality can be implemented.

                                ASP.NET WebForms:
                                By default, a wait form powered by the ASPxLoadingPanel Class is already displayed for any operation in XAF Web UI (it can be hidden if the browser window lost focus, though). You can also use standard ASP.NET WebForms approaches for displaying a custom loading dialog, e.g. check out the How to start a long running operation in ASP.NET application using the ThreadPool.QueueUserWorkItem method and show its progress in a browser using a WebService method article.

                                NOTE: since executing long tasks and reporting progress is a general programming task, which is not related directly to XAF, you may want to look for more options in public community resources like MSDN, StackOverFlow, etc., which are devoted to the target platforms you are developing for, e.g.:  http://stackoverflow.com/search?q=.net+background+tasks

                                Show all comments
                                • Ken Grant 04.05.2013

                                  What is the curent status of this request. Is there fuctionallty in v12.2 that has this built in?
                                  Ken grant

                                • Dennis (DevExpress Support) 04.05.2013

                                  @Ken: It was always possible in XAF to implement your custom async Actions (this is no different from accomplishing this task in regular non-XAF apps), but not all system Actions and service operations are asynchronous by default.

                                • Nate Laff 04.05.2013

                                  It may shock support and Dennis to hear but I don't see the need for this one. When I need to do something async in my XAF app I kick off a thread and show the built-in WaitForm until it's done.

                                • drew.. 04.05.2013

                                  hey Nate, perhaps my coffee has not kicked in yet, but why bother going async if you are just going to wait?

                                • Dennis (DevExpress Support) 04.05.2013

                                  The beauty of async operations is that you can run a huge report, then search for data in a different window/tab while something heavy is being calculated behind the scenes.
                                  You can easily implement this with custom Actions, but doing it for system ones requires more coding and time to ensure that all standard scenarios work as expected (for instance, you open one View in one tab, then navigate to a different View and somehow change data related to the first View in it - these collisions need to be somehow resolved to avoid confusion).

                                • Nate Laff 04.05.2013

                                  Sorry. For Async I use AlertControl.

                                • Alex Schille 04.05.2013

                                  what about...
                                  XPObjectSpace os = ...
                                  os.Session.GetObjectsAsync() Method?
                                  I tried to implement it, but it seems to be Sync... implementing a Extension-Method in .NET 4.5 (with async and await) solved the problem but what is about .NET 4.0 ... ?
                                  here is the code:
                                  public static class ObjectSpaceExtensions
                                      {
                                          public static void GetObjectsAsync<T>(this IObjectSpace objectSpace, CriteriaOperator criteria, Action<IList<T>, Exception> callback)
                                              where T : class
                                          {
                                              var xpObjectSpace = objectSpace as XPObjectSpace;
                                              var info = from c in xpObjectSpace.Session.Dictionary.Classes.Cast<XPClassInfo>()
                                                         where XafTypesInfo.CastTypeToTypeInfo(c.ClassType).Type == typeof(T)
                                                         select c;
                                              if (info != null && info.Count() > 0)
                                                  xpObjectSpace.Session.GetObjectsAsync(info.First(), criteria, null, 0, false, false, (objects, ex) =>
                                                      {
                                                          if (objects != null)
                                                              callback(objects[0].Cast<T>().ToList(), ex);
                                                      });
                                          }
                                          public async static Task<IList<T>> GetObjectsAsync<T>(this IObjectSpace objectSpace, CriteriaOperator criteria)
                                              where T : class
                                          {
                                              ICollection[] collection = null;
                                              Exception exception = null;
                                              var xpObjectSpace = objectSpace as XPObjectSpace;
                                              var info = from c in xpObjectSpace.Session.Dictionary.Classes.Cast<XPClassInfo>()
                                                         where XafTypesInfo.CastTypeToTypeInfo(c.ClassType).Type == typeof(T)
                                                         select c;
                                              if (info != null && info.Count() > 0)
                                                  xpObjectSpace.Session.GetObjectsAsync(info.First(), criteria, null, 0, false, false, (objects, ex) =>
                                                      {
                                                          collection = objects;
                                                          exception = ex;
                                                      });
                                              await new TaskFactory().StartNew(() =>
                                              {
                                                  while (collection == null) { }
                                                  Thread.Sleep(5000); // nur zum testen!!!
                                              });
                                              if (collection != null)
                                                  //return await new TaskFactory().StartNew<IList<T>>(() => collection[0].Cast<T>().ToList());
                                                  return collection[0].Cast<T>().ToList();
                                              return null;
                                          }
                                      }

                                • Dennis (DevExpress Support) 04.05.2013

                                  BTW, here is an example on how to use it in XAF: How to use the AlertControl in XAF?.

                                • Sistemas para su empresa E.I.R.L 11.28.2016

                                  After all these years, is this answer still valid? 

                                • Dennis (DevExpress Support) 11.28.2016

                                  @EnterpriseSoft - Chachapoyas - Peru:
                                  These solutions for the most common cases for which our customers contacted us are still valid. If you describe your particular business task in detail in a separate ticket (https://www.devexpress.com/Support/Center/Question/Create), our team will be in a better position to suggest a more specific solution, because your case may be different, and so the possible options could be as well.

                                • Dennis (DevExpress Support) 08.22.2019

                                  Hello Everyone,

                                  XAF ships with asynchronous method support in IObjectSpace in v19.2. To learn more about the new IObjectSpaceAsyncinteface and custom async operations in WinForms apps, please read this knowledge base article and respond to a few questions from the R&D team. This will help shape future development plans - asynchronous operations within standard XAF WinForms and Blazor UI modules.