Loading ...
Sorry, an error occurred while loading the content.

Can SimpleDialog return true/false to the caller

Expand Messages
  • Felix Rabinovich
    I am trying to implement a very simple use case. Say, I have a program that calls if confirm() { ... } else { ... }. Let s say the dialog is too complex for
    Message 1 of 3 , Dec 2, 2007
    • 0 Attachment
      I am trying to implement a very simple use case. Say, I have a program that calls if confirm() { ... } else { ... }.

      Let's say the dialog is too complex for simple confirm() call. Maybe, I need to have a textbox on the dialog, or even have asyncRequest to populate such textbox. So, I want to use SimpleDialog instead of confirm. However, all the examples transfer control to the SimpleDialog. For example, the comments to handleYes in the examples say
       //user confirms the deletion of this item;
      //this method would perform that deletion;
      //when ready, hide the SimpleDialog:
      Is it possible to *call* a modal SimpleDialog, and get yes or no, along with the values of other fields on the form to the caller. It looks like currently calling operation doesn't suspend when it instantiates SimpleDialog. So, in the example above handleYes would return true to the caller.

      I looked at the discussion here but it isn't quite the same.
      Thank you
    • Felix Rabinovich
      I was wondering if there is no response because: 1. The answer is no, but nobody is 100 per cent sure, 2. I wasn t clear in explaining the situation or
      Message 2 of 3 , Dec 14, 2007
      • 0 Attachment
        I was wondering if there is no response because:
        1. The answer is no, but nobody is 100 per cent sure,
        2. I wasn't clear in explaining the situation or question, or
        3. It's stupid to want to do something like that, so even if it's not
        possible - there are better ways to do it.

        Thanks in advance
        Felix
      • jingceawlin
        Yes, simpledialog doesn t suspend. You have to use event callback
        Message 3 of 3 , Dec 14, 2007
        • 0 Attachment
          Yes, simpledialog doesn't suspend. You have to use event callback

          --- In ydn-javascript@yahoogroups.com, "Felix Rabinovich" <felix@...>
          wrote:
          >
          > I am trying to implement a very simple use case. Say, I have a program
          > that calls if confirm() { ... } else { ... }.
          >
          > Let's say the dialog is too complex for simple confirm() call. Maybe, I
          > need to have a textbox on the dialog, or even have asyncRequest to
          > populate such textbox. So, I want to use SimpleDialog instead of
          > confirm. However, all the examples transfer control to the SimpleDialog.
          > For example, the comments to handleYes in the examples say
          > //user confirms the deletion of this item;
          > //this method would perform that deletion;
          > //when ready, hide the SimpleDialog:
          > Is it possible to *call* a modal SimpleDialog, and get yes or no, along
          > with the values of other fields on the form to the caller. It looks like
          > currently calling operation doesn't suspend when it instantiates
          > SimpleDialog. So, in the example above handleYes would return true to
          > the caller.
          >
          > I looked at the discussion here
          > <http://tech.groups.yahoo.com/group/ydn-javascript/message/21533> but
          > it isn't quite the same.
          > Thank you
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.