[CLOSED] Can't reach handler (through messagebox).

  1. #1

    [CLOSED] Can't reach handler (through messagebox).

    What Am I doing wrong here ?

    <%@ Page Language="C#" %>
    <script runat="server">
    
    
        [DirectMethod]
        public void AreYouSureClose()
        {
            X.Msg.Show(new MessageBoxConfig
            {
                Title = "Afhandelen",
                Message = "Reason",
                Width = 300,
                Buttons = MessageBox.Button.OKCANCEL,
                Multiline = true,
                Closable = false,
                AnimEl = btnOpen.ClientID,
                MessageBoxButtonsConfig = new MessageBoxButtonsConfig
                {
                    Ok = new MessageBoxButtonConfig
                    {
                        Text = "Afhandelen"
                    },
                    Cancel = new MessageBoxButtonConfig
                    {
                        Text = "Annuleren"
                    }
                },
                Fn = new JFunction { Handler = "alert('test');" }
            });
        }
    
    
    </script>
     
    <!DOCTYPE html>
     
    <html>
    <head id="Head1" runat="server">
        <title>Test</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Button ID="btnOpen" runat="server" text="Open MessageBox">
                 <Listeners>
                    <Click Handler="App.direct.AreYouSureClose();" />
                 </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
    Last edited by Daniil; Mar 12, 2013 at 10:11 AM. Reason: [CLOSED]
  2. #2
    Hi Martin,

    Seems you do everything right, but Fn doesn't work for some reason. We will investigate.

    For now please use
    Handler = "alert('test');"
    instead of
    Fn = new JFunction { Handler = "alert('test');" }
  3. #3
    Corrected in SVN. Now your initial sample works.

    Please note that you can set up a separate Handler for each button in the MessageBoxButtonsConfig. But MessageBoxConfig's Fn will be ignored in this case.
  4. #4
    Quote Originally Posted by Daniil View Post
    Hi Martin,

    Seems you do everything right, but Fn doesn't work for some reason. We will investigate.

    For now please use
    Handler = "alert('test');"
    instead of
    Fn = new JFunction { Handler = "alert('test');" }
    I used a handler for test reasons, but in my original code I use: Fn = new JFunction { Fn = "closeIssue" }
    Could not reach the function also and I used a simular syntax before..

    Grtz

    Martin
  5. #5
    Quote Originally Posted by Daniil View Post
    Corrected in SVN. Now your initial sample works.

    Please note that you can set up a separate Handler for each button in the MessageBoxButtonsConfig. But MessageBoxConfig's Fn will be ignored in this case.
    Thanks. Will look into that..

    It worked before btw, so somewhere during an initial SVN update it got screwed :)

    Marti

Similar Threads

  1. Replies: 2
    Last Post: Apr 11, 2012, 2:15 PM
  2. [CLOSED] Fn vs Handler (when to use Fn and Handler)
    By hgouw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 21, 2011, 1:39 AM
  3. [CLOSED] Reach Command coloumn at run time with javascript
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 10, 2010, 5:40 AM
  4. Ext.MessageBox
    By dbassett74 in forum 1.x Help
    Replies: 3
    Last Post: May 26, 2009, 6:13 PM
  5. [CLOSED] Reach TextField ctrl via code behind
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 15, 2008, 1:52 PM

Posting Permissions