Ticket Q365097
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Platform-Agnostic API for Text Notifications

Displaying modal pop-up conformation dialog/message box

created 13 years ago

Hi
In my web app->View Controller->ObjectSpace_Committed I need to show a popup modal dialog confirming the record has been saved and some other info. How can I achieve this functionality? Would appreciate some details and if possible a short code example.
Many Thanks
Regards
Yahya

Show previous comments (10)

    Hi Dennis
    Many thanks. It works great for Save. However for Save and Close popup does not get a chance to appear. Any way to make the popup appear for Save and Close too, then let the user close the popup before view is closed?
    Thanks
    Regards
    Yahya

    Dennis Garavsky (DevExpress) 13 years ago

      Hello Yahya,
      Displaying a popup on SaveAndXXX does not work because we are adding it to the current View controls collection. Since the View is closed during the operation, no popup is displayed correspondingly.
      You can try to add the popup control to the page controls hierarchy: WebWindow.CurrentRequestPage.Form.Controls.Add(popup);
      but I think there should be a better solution. I need some time to look for it. Please bear with me.
      Thanks,
      Dennis
      P.S.
      BTW, is displaying popup to notify users of a saving operation the only way of accomplishing this task? What about displaying some status information in the top panel or similar?

        Hi Dennis
        I need a mechanism that shows a message after save and then user selects OK (or Close) and then the remaining code is executed. Modal popup is preferable as it blocks user from doing anything except to close popup before proceeding.
        Thanks
        Regards
        Yahya

        Answers

        created 13 years ago (modified 9 years ago)

        Hi Yahya,
        Attached is a small sample project that operates fine. Note that we had to add a popup control directly into the Default.aspx markup to avoid the issue I described above.
        Here are the full implementation steps:
        1. Modify the YourSolutionName.Web/Default.aspx file markup as follows:

        ASPx
        <%@ Page Language="C#" AutoEventWireup="true" Inherits="Default" EnableViewState="false" ValidateRequest="false" CodeBehind="Default.aspx.cs" %> <%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="cc5" %> ... <form id="form2" runat="server"> ... <cc5:ASPxPopupControl runat="server" ID="PopupControl" ClientInstanceName="Popup" Modal="true" AllowDragging="true" EnableClientSideAPI="true"></cc5:ASPxPopupControl> ... </form>

        2. Include the controller below into the YourSolutionName.Module.Web project:

        C#
        using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Web; namespace Q365097_1529.Module.Web.Controllers { public class ShowPopupViewController : ViewController { private void ObjectSpace_Committed(object sender, EventArgs e) { WebWindow.CurrentRequestWindow.RegisterStartupScript("showPopupScript", "Popup.Show();"); } protected override void OnActivated() { base.OnActivated(); ObjectSpace.Committed += new EventHandler(ObjectSpace_Committed); } protected override void OnDeactivated() { ObjectSpace.Committed -= new EventHandler(ObjectSpace_Committed); base.OnDeactivated(); } } }

        Now, a popup window will be shown every time you save your business objects.

        Please let us know if this solution meets your business requirements.
        Thanks,
        Dennis
        P.S.
        Can I make this ticket public so that other users could access this sample project?

          Show previous comments (1)
          Dennis Garavsky (DevExpress) 13 years ago

            Thank you Yahya!
            Regards,
            Dennis

            DK DK
            Dimitris Karaggelos 9 years ago

              It appears the example is out of date - can't get it to build. Is it possible to update it for the current XAF version?

              Thanks in advance,

              Dimitris

              Dennis Garavsky (DevExpress) 9 years ago

                @Dimitris: I've updated my original answer. I hope this helps.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.