<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: MessageBox callback event in loop in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956027#M4494328</link>
    <description>&lt;P&gt;Hi Abdel,&lt;/P&gt;&lt;P&gt;Thanks. Would you please provide some example?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik S&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2019 08:09:48 GMT</pubDate>
    <dc:creator>former_member190063</dc:creator>
    <dc:date>2019-07-17T08:09:48Z</dc:date>
    <item>
      <title>MessageBox callback event in loop</title>
      <link>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaq-p/11956024</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;
  &lt;P&gt;I have a MessageBox in my for loop. There are two buttons (yes and No) inside messageBox. I am expecting the loop control to wait until user action from the MessageBox buttons. Would it be possible. I know MessageBox is asynchronous. I am looking for an alternative. &lt;/P&gt;
  &lt;P&gt;Example:&lt;/P&gt;
  &lt;P&gt;var array = [file1, file2, file3];&lt;/P&gt;
  &lt;P&gt;for(var i = 0; i &amp;lt; array.length; i++){&lt;/P&gt;
  &lt;P&gt;if(array[i] === "file1"){&lt;/P&gt;
  &lt;P&gt;MessageBox.confirm("File exists already. Do you want to Replace or Create?", { actions: ["Yes", "No"], &lt;/P&gt;
  &lt;P&gt;onClose: function (sAction) { &lt;/P&gt;
  &lt;P&gt;if (sAction === "Yes") { &lt;/P&gt;
  &lt;P&gt; //Make a call to backend&lt;/P&gt;
  &lt;P&gt;// &lt;/P&gt;
  &lt;P&gt;} else { &lt;/P&gt;
  &lt;P&gt;//Make a call to backend&lt;/P&gt;
  &lt;P&gt; } }});&lt;/P&gt;
  &lt;P&gt;}&lt;/P&gt;
  &lt;P&gt;I have to validate for each element in the array. Whenever matches found, Messagebox appears and user has to select the buttons inside it. But loop control won't stops for user event from MessageBox. Can we use nested callbacks in this case? &lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;
  &lt;P&gt;Karthik S&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 13:47:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaq-p/11956024</guid>
      <dc:creator>former_member190063</dc:creator>
      <dc:date>2019-07-16T13:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: MessageBox callback event in loop</title>
      <link>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956025#M4494326</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;karthik.s31&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;I think you need to change your coding logic and use callbacks.&lt;/P&gt;&lt;P&gt;Instead of a simple loop, I would also use some resistivity with the MessageBox.confirm onClose callback where I would remove one array element after checking that element and then callback the intial entry point function.&lt;/P&gt;&lt;P&gt;The array would reduce as you check items.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 15:02:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956025#M4494326</guid>
      <dc:creator>AbdelhalimDadouche</dc:creator>
      <dc:date>2019-07-16T15:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: MessageBox callback event in loop</title>
      <link>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956026#M4494327</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think this might help.&lt;/P&gt;&lt;P&gt;Check this link I found thru google: &lt;A href="https://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example"&gt;StackOverflow - JS Closure inside loops&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 04:21:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956026#M4494327</guid>
      <dc:creator>agrawalaadhar8</dc:creator>
      <dc:date>2019-07-17T04:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: MessageBox callback event in loop</title>
      <link>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956027#M4494328</link>
      <description>&lt;P&gt;Hi Abdel,&lt;/P&gt;&lt;P&gt;Thanks. Would you please provide some example?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik S&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 08:09:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/messagebox-callback-event-in-loop/qaa-p/11956027#M4494328</guid>
      <dc:creator>former_member190063</dc:creator>
      <dc:date>2019-07-17T08:09:48Z</dc:date>
    </item>
  </channel>
</rss>

