[CLOSED] Prompt before DirectEvent

  1. #1

    [CLOSED] Prompt before DirectEvent

    Hi,
    I have a javascript function that will ask users if ok to proceed.
    I thought that by returning false, the direct event would be cancel..but the success event fires even before the user can answer the confirmation..

        function CheckForSectorChange()
        {
        if ((#{hidInitSectorTeam}.getValue() != #{cmboSectorTeam}.getValue()) |  (#{hidInitAnalyst}.getValue() != #{cmboAnalyst}.getValue()))
        {
            Ext.Msg.confirm('Workflow Restart', 'You are changing either the sector team, or the analyst for a fund that has a running Investment Review. If you continue, you will be restarting the workflow. Do you agree?', function(btn, text) {
            if (btn == 'yes')  
            {              
            return true; 
            }
            else
             return false;
            });
       }
        else
            return true;
                              
        }

    Button:
        <ext:Button runat="server" ID="Button2" Text="Save" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="ChangeDetail" Before="CheckForSectorChange();" Failure="Ext.Msg.alert('Failure',result.errorMessage);#{winDetailChange}.hide(); "
                        Success="UpdateDetailLabels(); #{winDetailChange}.hide(); Ext.Msg.alert('Success','Details have been saved.');">
                        <ExtraParams>
                            <ext:Parameter Name="ListValues" Value="Ext.encode(#{lstStyles}.getRowsValues())"
                                Mode="Raw" />
                        </ExtraParams>
                    </Click>
                </DirectEvents>


  2. #2

    RE: [CLOSED] Prompt before DirectEvent

    Hi,

    Ext.Msg.confirm is async function (it doesn't block current context execution)
    Please use classic 'confirm' method or DirectEvent confirmation functionality (second button - DirectEvent with confirmation)
    http://examples1.ext.net/#/Events/Di...ents/Overview/
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] Supported browsers prompt message
    By bakardi in forum 1.x Premium Help
    Replies: 5
    Last Post: Jan 27, 2015, 7:04 AM
  2. Replies: 9
    Last Post: Nov 23, 2012, 4:13 AM
  3. [CLOSED] MessageBox prompt with required field
    By jchau in forum 1.x Premium Help
    Replies: 2
    Last Post: Feb 23, 2012, 5:39 PM
  4. Custom Prompt MessageBox
    By EzaBlade in forum 1.x Help
    Replies: 2
    Last Post: Nov 04, 2009, 12:14 PM
  5. Get the value from prompt dialog and save
    By CoolNoob in forum 1.x Help
    Replies: 5
    Last Post: Oct 23, 2009, 3:13 PM

Posting Permissions