Current filter:
                                You should refresh the page.

                                3 Solutions

                                Creation Date Importance Sort by

                                XAF 17.1+
                                Text notification display (e.g. confirmation messages, warnings, errors) has been simplified for desktop and Web XAF applications with the help of the platform-agnostic DevExpress.ExpressApp > ShowViewStrategyBase > ShowMessage  method. You can quickly learn more about it from this blog as a preview of this functionality was already available in XAF v16.2.5+.
                                With v17.1, this functionality was greatly extended based on customer feedback and you can research it further in the FeatureCenter and SimpleProjectManager demos:

                                We also look forward to hearing from you once you have had an opportunity to try this extended ShowMessage functionality in v17.1 (please submit separate tickets using the service for that purpose).

                                • Farooq 04.18.2017

                                  Hi Dennis,

                                  Many thanks to you and the DevExpress XAF team for provviding this long awaited functionality. Will try it soon. And a bit curious to know whether there is an option which when enabled shows the confirmation messages automatically ( like onSaved or OnDeleted, etc...)

                                  My project has over 100 business objects and was always looking to apply save conformation to inform the user about the success of save acrion.

                                • Dennis (DevExpress Support) 04.18.2017

                                  @Mohammed: Even though there is no option exactly for this scenario, it is quite straightforward to implement it using a custom ViewController by subscribing to the IObjectSpace events.
                                  We will be happy to receive more feedback from you once you test this feature live. I would kindly ask you to submit separate tickets using the service for each issue or suggestion you might have not to distract other XAF users tracking this thread. Thanks for your understanding.

                                • Ron Veerman 11.14.2017

                                  This is perfect Dennis! I missed it somehow. A true improvement of my XAF web applications. Thanks!


                                Additional information:

                                With version 16.2, the use of custom dialogs has been simplified for both WinForms and ASP.NET applications. The ShowViewStrategyBase.ShowViewInPopupWindow method displays the specified View in a popup dialog with OK and Cancel buttons.

                                Application.ShowViewStrategy.ShowViewInPopupWindow(Application.CreateListView(typeof(Contact), true));

                                You can also pass the okDelegate and cancelDelegate  parameters to this method, to specify the code to be executed when the OK and Cancel  buttons are clicked. Button captions can be customized using the okButtonCaption and cancelButtonCaption parameters.

                                The ShowViewInPopupWindow method provides a platform-agnostic way to display popup dialogs from your code. However, there are certain specifics in ASP.NET applications:
                                - The ShowViewInPopupWindow method can be used on XafCallbackManager callbacks initiated by the RaiseXafCallback script. It cannot be used on callbacks of controls (e.g., grid sorting).
                                - It is impossible to pause the current request to wait for the user input.
                                - Main window is not refreshed when the Cancel button is clicked.

                                Show all comments
                                • Sistemas para su empresa E.I.R.L 01.16.2017

                                  Not Work.

                                  namespace Solution28.Module.Controllers { public partial class ViewController1 : ViewController { public ViewController1() { InitializeComponent(); RegisterActions(components); } private void popupWindowShowAction1_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) { //Do something when the OK button is pressed. } private void popupWindowShowAction1_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { //e.View = e.Application.CreateDashboardView(e.Application.CreateObjectSpace(), "ConfirmationMessageView", false); Application.ShowViewStrategy.ShowViewInPopupWindow(Application.CreateListView(typeof(DomainObject1), true)); } private void popupWindowShowAction1_Cancel(object sender, EventArgs e) { //Do something when the Cancel button is pressed. } } }
                                • Dennis (DevExpress Support) 01.16.2017

                                  @EnterpriseSoft - Chachapoyas - Peru:
                                  Your custom code is technically wrong and is supposed to throw an exception, as expected. I will elaborate more on this in a separate ticket I created on your behalf (T472674: Questions on the ShowViewInPopupWindow and PopupWindowShowAction usage).

                                • Farooq 01.19.2017

                                  Hi Dennis,

                                  Could you show us on how to use this ShowViewInPopupWindow function from a XPO business object class. 

                                • Mario Blatarić 01.19.2017

                                  Mohammed, if you are trying to show dialog from XPO business class, you have code in the wrong place.
                                  Business class should never deal with UI, actually it should never deal with anything beyond its own instance.
                                  You should refactor your code and move UI piece to controller, probably in ObjectSpace.ObjectChange or ObjectSpace.Committing - depending on your scenario.

                                  This was confusing for me in the beginning, but once you get a hang of it - it actually makes sense and it is easy to implement.


                                • Farooq 01.19.2017

                                  Alright Mario, I was a bit confused as well, and now things are clear for me. I will take care of it in my code as per your suggestion.

                                • Dennis (DevExpress Support) 01.19.2017

                                  Yes, Mario is absolutely correct (thanks for your help!). This concept is not directly related to XAF, and you can learn more about it from public community resources:
                                  If you experience any further difficulties, do not hesitate to submit separate questions using the service. Thanks.

                                • Robert Fuchs 01.19.2017

                                  @Dennis @Mario
                                  What Mohammed basically wants to achieve is to send a message from a BO to a view.
                                  That's not wrong per se, that's why the Messenger class exists in MVVM and the like.
                                  XAF's MVC just doesn't have a Messenger, AFAIR.

                                • Mario Blatarić 01.19.2017

                                  XAF is a bit different since it is not just MVC it is also application generator which means "view" part is dynamic and you do not deal with it as in traditional MVC system.
                                  This is where XAF controllers come into play - they both controllers in traditional sense (where you define business logic), but is also a "link" between model and view since controllers are only way to access view in runtime.

                                  Additionally, XAF already has many integrated modules which help you solve standard issues. For instance, you use Appearance and Validation module to decorate business classes and members and achieve quite many results like custom coloring, checking values in many different ways, providing validation message to UI and so on.

                                  So in XAF, controller class is a bit more than in traditional MVC and it is the place where you register events which respond to certain business object events and delegate information towards view. There are plenty events to do so it all depends on specific requirements.
                                  But business object should handle ONLY itself, be that setter method that set another members based on value, or doing some in-instance logic in OnSaving method or initializing in AfterConsutruction. Even appearance and validation module are designed to follow this - you always validate one particular instance of a class.

                                  For instance, if you want to check some things before you save object, you might want to do that in object's OnSaving method - but that would be wrong. Instead, you create controller for that class and subscribe to ObjectSpace.Committing/Commited event or ObjectSpace.ObjectChanged event where you can respond to any object change or do any additonal checks before saving data - and there you can then show dialogs, exceptions or whatever else you need to do.
                                  That way business object remained clean, dealing only with itself and you know that any additional logic is inside controller.
                                  True, there is a learning curve. When I look at my first XAF project - and get strong desire to rewrite it from scratch :-)
                                  But once you get a grasp of it, it feels very natural, powerful and well designed.


                                I want to close this ticket with a solution that was successfully used by many of our users through these years.
                                You can write a platform-agnostic code for displaying a confirmation dialog by usingPopupWindowShowAction that will display a DetailView of a non-persistent object or even a DashboardView with a text, image, etc. Take special note that you can also use other approaches to display this dialog (e.g., without using Actions): Ways to Show a View.
                                It is easy to implement and, taking into account ASPxPopupControl integration in 12.1, this looks like a good solution that fully meets the original requirement. Attached is a small sample project + a screenshow showing how it looks in Win and Web UI.
                                To use this solution in your project, copy the Solution28.Module/Model.DesignedDiffs.xafml and Solution28.Module/Controllers files into your platform-agnostic module.
                                Finally, in case you want to display a simple error message for both platforms, you can throw a UserFriendlyException. If you want to display a message box from your persistent object scope, you can use solutions described in the following threads:
                                Web - implement windows-like MessageBox
                                Generic Message Box

                                Show all comments
                                • Marco Castro 04.23.2013

                                  Hello Dennis,
                                  This application don't be compiled in version Could you please adjust it?
                                  Marco Castro

                                • Dennis (DevExpress Support) 04.24.2013

                                  Marco, I cannot update it right now, but you can copy the Solution28.Module/Model.DesignedDiffs.xafml file and the content of the Solution28.Module\Controllers folder into your XAF solution, and it will work fine. You do not need other parts of this example as they do not relate to the described solution.

                                • Dennis (DevExpress Support) 04.25.2013

                                  I have created a new Code Central example to demonstrate how to accomplish this task: How to invoke a View without using Actions or from a place that is different from the Controller context.

                                • Martin Praxmarer - DevExpress MVP 04.25.2013

                                  One question Dennis - in your ApplicationHelper you hold an static instance of an application - isnt that dangerous in an web application...? i use something similar, and found that i run into several problems with it...?

                                • Dennis (DevExpress Support) 04.25.2013

                                  Thanks for the feedback, Noxe. I added the Web project later, so I forgot to update it accordingly. The updated Web-optimized version should appear on our web site in a few minutes.

                                • Martin Praxmarer - DevExpress MVP 04.25.2013

                                  thx ;)

                                • Daniele M 01.22.2014

                                  it seem that E760 ( is offline. is it normal? E761 and E759 are online

                                • Dennis (DevExpress Support) 01.22.2014

                                  @Daniele: This example is currently being refactored and is not available online. You can consider checking the How to invoke a View without using Actions or from a place that is different from the Controller context KB Article or the sample project above (you need the XAFML settings and ViewController1 from it). Thanks.

                                • Scott Gross 04.17.2017

                                  Thank you, this works great for our needs to show a Message Box. I just added a NonPersistant Class with an Image and Text with the HTML control and works as expected!

                                • Duane Coleman 08.01.2017

                                  Hi Dennis, The projects that you attached(dxSampleS19008_16.1.6(12.2_Compatible)) has working popup. When I tried implementing the same in my project it still comes out as a modal popup. Why is that so?

                                • Duane Coleman 08.01.2017

                                  Here's your screenshot

                                • Dennis (DevExpress Support) 08.02.2017

                                  @Duane: I've created a separate ticket on your behalf (T541695: New Web UI - How to show a popup confirmation window in the center of the screen). It has been placed in our processing queue and will be answered shortly.