1. #11
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    You'll have to return false from the beforeselect handler, and finally programatically select the combobox value when the user confirms in a callback.

  2. #12
    Sencha User Novalis's Avatar
    Join Date
    Jul 2008
    Posts
    21
    Vote Rating
    0
    Novalis is on a distinguished road

      0  

    Default


    thx for that. but it does not work i am afraid.
    i have lot's of information displayed, where users can make changes...
    the checkbox will load different information. but if changes are made a warning (confirm) will show up, asking if they want to load new stuff, without saving the old.
    with the select onchange the new information is loaded and the changes made, are lost. so programaticly i would need to save the changes and then restore them on false.
    i know, i could do it otherway, with restructuring the code, putting some more handlers. but since its a heavy layout, and i don't want a week of work. so i keep the js confirm.
    it still shows how a syncron confirm would come in handy.
    in general things are, what they look like

  3. #13
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    0
    devnull has a little shameless behaviour in the past

      0  

    Default


    You are not listening to the solution being offered. The event can be canceled before you even throw up the confirm box. Then, if the user chooses to continue with the action, your code can initiate the event again. Its not hard to do, and should not require large changes to your application if you have followed good code design patterns.

  4. #14
    Sencha User Novalis's Avatar
    Join Date
    Jul 2008
    Posts
    21
    Vote Rating
    0
    Novalis is on a distinguished road

      0  

    Default


    right, the changes are not lost because i canceled the event. this my mistake. hmm, i wonder what went wrong then. i give it another try.
    in general things are, what they look like

  5. #15
    Sencha User
    Join Date
    Sep 2008
    Posts
    38
    Vote Rating
    0
    zeruyo is on a distinguished road

      0  

    Default


    Hi everybody, this is my first post in this forum.

    I agree that thinking in an event driven way I should manage async flow but there is a task i'm not able to solve. Scenario:
    tipical web filemanager app, I have to copy some files from a folder to another in one shot with overwrite check. I run through a loop for each file to copy, checking via ajax if files with the same name already exist in the target folder. I ask with a Ext.Msg or Ext.Window whether overwrite existing files or not (maybe asking to perform same action for all following files). If I'm not able to stop execution of the code the risk is to have several confirm windows opening one over other. Any ideas about that? Thanks a lot

    P.S. the problem also involves the Ext.ajax async requests but in this forum I've already found an 'elegant' patch to do sync ajax request

  6. #16
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    0
    devnull has a little shameless behaviour in the past

      0  

    Default


    In that particular case, run the entire operation and just keep track of errors internally, then when its done either prompt the user for each error one at a time or incorporate all the errors into one dialog. repeat until there are no errors.

  7. #17
    Ext User
    Join Date
    Apr 2009
    Posts
    8
    Vote Rating
    0
    CorpsusVitale is on a distinguished road

      0  

    Default


    How would you guys go about the following case:

    1. The user navigates to a page where he can enter a data into a form
    2. The user presses the back button or any other button over which you have no control (home, favorites, etc)
    3. Before actually leaving the page, the user gets the option to save the data entered or discard it. At this moment we use a 'normal' confirm dialog in the onunload event. When the user chooses to save the data, the form gets sent to the server using Ajax.

    The onunload event is blocked due to the synchronous nature of the 'normal' confirm dialog. Without blocking the page containing the form is unloaded before a callback function can be called with the asynchronous messagebox. How would you solve this 'problem'?

  8. #18
    Sencha User
    Join Date
    Jul 2009
    Posts
    66
    Vote Rating
    1
    ssawchenko is on a distinguished road

      0  

    Default


    I was having a similar issue; I had a submit button and I wanted to do a confirmation before sending the post. Problem was, because the confirm is asynchronous the confirm would pop up but the post would immediately get called and change my page.

    I'm not sure this is the OP's issue, but I figured others reading this may have been in the same boat as me.

    I solved this by moving the buttons outside of my form and then calling the form post manually only after the confirmation came back from the message box.

    In pseudo-code
    HTML:
    Code:
    <form  id="myform" action="myaction">
      <input ...>
    </form>
    <input  type="submit" onclick="confirm()" />
    Javascript (I used jquery to get the form, but I imagine getElementByID would work the same):
    Code:
    function confirm()
      {
          Ext.MessageBox.confirm('Delete System(s)', 
           'Delete the  selected Systems?', 
           function(btn){
               if (btn ==  'yes') { $("#myform").submit(); }
           });
      }