Ext.MessageBox

  1. #1

    Ext.MessageBox

    I know this won't be out until v0.8, but I had a question regarding this. Will it provide some sort of "modal" functionality? For example, it is quite common that you need to allow the user to hit the OK button before it continues on processing something. For example (pseudocode):


    Select Case MessageBox.Result
    Case OK: AjaxMethod1
    Case Cancel: AjaxMethod2
    End Select

    Will this be available with this control? Until then, how can I accomplish something like this with the Ext.Msg class?
  2. #2

    RE: Ext.MessageBox

    Hi dbassett74,

    I just happened to be adding some new functionality to the Ext.MessageBox class and it's related to your question.

    If using v0.8, the following sample demonstrates how you could accomplish conditional logic with the new ButtonsConfig object.

    Example

    Ext.Msg.Confirm("Message", "Confirm?", new MessageBox.ButtonsConfig
    {
        Yes = new MessageBox.ButtonConfig
        {
            Handler = "CompanyX.DoYes()",
            Text = "Yes Please"
        },
        No = new MessageBox.ButtonConfig
        {
            Handler = "CompanyX.DoNo()",
            Text = "No Thanks"
        }
    }).Show();
    I added a new sample demonstrating this sample to the Examples Explorer which is available at the following location if you have SVN access, see /Examples/MessageBox/Basic/ButtonsConfig/

    I'll post a follow-up demonstrating similar functionality with v0.7.

    Geoffrey McGill
    Founder
  3. #3

    RE: Ext.MessageBox

    Here's basically the same functionality using hand rolled JavaScript which would be required if using v0.7.

    Example

    string script = "Ext.Msg.confirm('Message', 'Confirm?', function (buttonId) { if(buttonId == 'yes') { Coolite.AjaxMethods.DoYes(); } else { Coolite.AjaxMethods.DoNo(); } } );";
    Hope this helps.

    Geoffrey McGill
    Founder
  4. #4

    RE: Ext.MessageBox

    Works great. Is there a way to set the Icon to one of the other messagebox icons?

Similar Threads

  1. [1.3] [2.0] No X.MessageBox from CodeBehind
    By ckarcz in forum 2.x Help
    Replies: 4
    Last Post: Mar 09, 2012, 4:59 PM
  2. MessageBox Example Not working
    By Tbaseflug in forum 1.x Help
    Replies: 5
    Last Post: Jun 18, 2009, 3:48 PM
  3. MessageBox - Cannot get working from Example
    By Tbaseflug in forum 1.x Help
    Replies: 4
    Last Post: Jun 17, 2009, 5:24 PM
  4. [CLOSED] The "Ext.MessageBox"
    By fabiomarcos in forum 1.x Help
    Replies: 4
    Last Post: Dec 02, 2008, 1:25 PM
  5. ExtJS MessageBox
    By jchau in forum 1.x Help
    Replies: 0
    Last Post: Oct 09, 2008, 10:30 AM

Posting Permissions