X.Msg does not show (Yes I added .Show())

  1. #1

    X.Msg does not show (Yes I added .Show())

    What ever I did, I could not show server side message using X.Msg.
    Please see simplified code below:

    .aspx:

    <body>
        <form id="likelyForm" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server"/>
            <div>
                <ext:Button ID="likelyConfigureButton" runat="server" Text="Configure">
                    <Listeners>
                        <Click Handler="#{likelyWindow}.show()"></Click>
                    </Listeners>
                </ext:Button> 
            </div>
        </form>
    
        <ext:Window ID="likelyWindow" runat="server" Hidden="true" Width="800" MinWidth="800" Resizable="false">
             <Items>  
                  <ext:GridPanel ID="likelyGrid" runat="server" StoreID="likelyStore" ColumnWidth="0.6" Height="400">      
                         ... grid definitions
                         <Buttons>
                               <ext:Button ID="btnSave" runat="server" Text="Save & Close" Icon="Disk" Disabled="true">
                                      <DirectEvents>
                                             <Click OnEvent="SaveClick" Success="#{likelyWindow}.close();window.location.reload();" Failure="alert(result.errorMessage);" >
                                             </Click>
                                       </DirectEvents>
                               </ext:Button>
                         </Buttons>
                  </ext:GridPanel> 
             </Items>
        </ext:Window>
    </body>
    aspx.cs:

           protected void SaveClick(object sender, DirectEventArgs e)
           {
                X.Msg.Alert("Server Time", DateTime.Now.ToString()).Show();
    
                X.Msg.Alert("Title", "Message").Show();
    
                X.Msg.Alert(null, null).Show(new MessageBoxConfig
                {
                    Title = "Title",
                    Message = "Message",
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.ERROR
                });
    
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "Title",
                    Message = "Message",
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.ERROR
                });
    
                e.Success = false;
                e.ErrorMessage = "error";
         }
    I tried the window component inside and outside of the form element.
    Any of the X.Msg trials does not show a message on client side. Colud you advice on this?
  2. #2
    Hello!

    Problem, is that you have set e.Success = false. Remove these lines:

    e.Success = false;
    e.ErrorMessage = "error";
    Also, you can show only one MessageBox at a time
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    Problem, is that you have set e.Success = false. Remove these lines:

    e.Success = false;
    e.ErrorMessage = "error";
    Also, you can show only one MessageBox at a time
    Thank you Baidaly. Yes when I do not set e.Success = false, Msg is shown. In this case, is it not possible to show server side message when e.success = false? I am using a custom validation function to validate grid contents. If validation fails, I am setting e.success = false and displaying the configuration errors. Otherwise, I could set e.ErrorMessage on server side and use result.errorMessage to display errors to the user via javascript. By this way, I can not use a common server side message format to display all warnings. Could you please share your suggestion for such a scenario?
  4. #4
    You have to choose either you use e.ErrorMessage or X.Msg.alert.

    Main point here that if you set
    e.Success = false
    Ext.NET will ignore any script because it means that you have connection problems, server error or other unexpected errors. However, you can handle this error with own Failure Handler.

    Also, it's useful to read the following thread: http://forums.ext.net/showthread.php...-error-message
  5. #5
    Quote Originally Posted by Baidaly View Post
    You have to choose either you use e.ErrorMessage or X.Msg.alert.

    Main point here that if you set
    e.Success = false
    Ext.NET will ignore any script because it means that you have connection problems, server error or other unexpected errors. However, you can handle this error with own Failure Handler.

    Also, it's useful to read the following thread: http://forums.ext.net/showthread.php...-error-message
    Thank you Baidaly. I got the point (; Now it works fine.

Similar Threads

  1. Replies: 1
    Last Post: Jan 17, 2014, 3:43 PM
  2. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  3. Replies: 1
    Last Post: Jan 27, 2012, 11:32 AM
  4. GroupingSummary - Not show the sum
    By Maia in forum 1.x Help
    Replies: 1
    Last Post: Jan 21, 2010, 6:21 AM
  5. [CLOSED] Added Records don't show up as modified
    By Dave.Sanders in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 21, 2008, 6:54 AM

Tags for this Thread

Posting Permissions