Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Display message during processing records

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Display message during processing records

    V11 WEB BASED DEVELOPMENT.

    I have an xbasic script where I build inventory file from different input files.
    I activate it right after user enters the as of end of date and clicks on Submit button.
    It works great. No problem.

    I wanted to display a screen message (Record number X) as the records are being processed
    through a loop. The time to process takes about five minutes and I really was hoping to display a message showing
    records in progress. Can some one point me in the right direction. I notice ui_yield() does not work with Web.

    #2
    Re: Display message during processing records

    Ooh, I'm also interested. This would be sweet.

    Comment


      #3
      Re: Display message during processing records

      I don't think Alpha has this directly available, but jQuery has something interesting.
      Here's a writeup explaining how the deferred object works, specifically the notify() and progress() bits:
      http://eng.wealthfront.com/2012/12/j...nt-client.html
      http://api.jquery.com/category/deferred-object/

      I have never used it, and have no idea how well it would "play" with Alpha. Probably would not.
      It would be interesting if an Alpha employee could comment on whether the A5 callback function could support this type of activity in the future. It would be extremely useful for long callbacks, especially when combined with a slider or similar.

      Comment


        #4
        Re: Display message during processing records

        This solution doesn't do a progress bar, but when my callbacks are going to take awhile, I usually start my action javascript with inline javascript that kicks off a message box:

        Code:
        A5.msgBox.show('Creating Budget','<div style=\'padding: 20px;\'><img src=\'CSS/A5System/Images/wait.gif\' />&nbsp;The new budget is being created.</div>','none',function() {});
        Then I add a second action javascript that does the Ajax callback to the Xbasic function.

        Then in the Xbasic code I hide the message box when approriate with:
        Code:
        A5.msgBox.hide();
        The message box will need to be hidden any time you are exiting or ending the function....

        If exiting the function due to some error, my code ends up looking something like this:

        Code:
        if flag = .f. then
        	cn.close() 
        	dim msg as c 
        	msg = "Could not execute query. Error reported was: " + cn.CallResult.text
        	msg = js_escape(msg)
        	dim jscmd as c
        	jscmd = "A5.msgBox.hide();" 
        	jscmd = jscmd + "alert('" + msg + "');"
        	[I]myFunctionName[/I] = jscmd
        	exit function 
        end if
        I often put something like this at the end of the function:

        Code:
        dim jscmd as c
        jscmd = "A5.msgBox.hide();"
        jscmd = jscmd + "alert('The blah blah blah is done.');"
        [I]myFunctionName[/I] = jscmd
        Carol King
        Developer of Custom Homebuilders' Solutions (CHS)
        http://www.CHSBuilderSoftware.com

        Comment


          #5
          Re: Display message during processing records

          Just fishing in the dark here but could you:

          pop up a window or frame with a unique ID and then during the loop keep reseting the contents of that window with a javascript command out of your xBasic during the loop? Then close that frame when it was finished?

          So, in an SQL example you'd do a con.CallResult.RowsAffected first to find out how many rows of data you will be processing.
          Then you'd do some simple math to figure out what kind of percentage of the call result one row would be.
          Then you'd keep looping through and by the time you get out of looping through your rows of data the data should be showing close to 100% before it closes the window/frame.

          Comment


            #6
            Re: Display message during processing records

            Hi Carol, Kartik was asking about a progress message which shows real-time progress:
            "325 or 2,345 records processed" for example. It would be continuously updated as the process progresses.
            I would really like to hear from Alpha on this one....hint hint nudge...

            Jinx, yes you could do 2 callbacks, the first one would show your suggested guess-timate. You could also store the # transactions and time that the last transaction took, and display this: "Last transaction of 2345 items took 4:23 to process. Estimated time remaining: 3:23 minutes".

            But the "best" way I can think of is to enhance the callback process (as an option) like how jQuery does it.
            Last edited by agillbb; 01-29-2013, 11:25 AM.

            Comment


              #7
              Re: Display message during processing records

              Thanks to you all.
              I think I will give up the idea of displaying message like number of records to process (count down)...
              The suggested solutions are too complex for me to follow. I was hoping something simple using msg_box where the msgbox does
              not stop with ok button. I guess I will wait for Alpha version 12 or 13....or may be not....We do not live in a perfect world for sure.

              Comment


                #8
                Re: Display message during processing records

                I would recommend you throw up a waiting message and say something like " Waiting ... this action will take up to 5 minutes to complete". You could also display a javascript clock timer which displays how many seconds have elapsed so far.

                Comment


                  #9
                  Re: Display message during processing records

                  OK, I've been trying to give this a go for S's and G's.
                  I need some thoughts from you guys.

                  I'm currently testing in a dialog and have tried to put this into an a5w page to no avail. It seems that the a5w page wants to execute all of it's code before rendereing my div

                  Anyway, in the dialog i've got this in an html container:
                  Code:
                  <div id = "progress" style = "BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid"><div id = "bar" style="BACKGROUND-COLOR: green; WIDTH: 50%">&nbsp</div></div>
                  I then made a button with this in it:
                  Code:
                  function setPercentage(id, percent)
                  {
                  var div = document.getElementById(id);
                  div.style.width = percent + "%";
                  }
                  Anyway I'm messing with it.  Thoughts would be appreciated
                  
                  setPercentage("bar",10);
                  When I try an xbasic function with a loop in it, it just completes the looping and then outputs the percentage.... I need a way to break it up.
                  Last edited by -Jinx-; 01-29-2013, 09:20 PM.

                  Comment


                    #10
                    Re: Display message during processing records

                    Is xbasic like JavaScript in that it will want to execute a for or while loop to the exclusion of all else. If I used an if-goto would it make a difference?

                    Comment


                      #11
                      Re: Display message during processing records

                      Jinx, not sure where you're going with this. Let me give you some pointers on how to proceed.

                      One way to "break it up" with the existing A5 callback architecture is: Say you had 1000 records to process, then you could perform a series of callbacks, each of which may process 100 items only, and report back when each is completed. Each successive callback could pass "starting record number" and "ending record number" values, and return a success indicator (i.e. set the text of a div) plus a recursive js call to fire the next callback. This way all your main logic is in xBasic, and it is actually quite straightforward. You will also need to get the total record count in each callback (or be passed it if it is previously known).

                      But you would be sacrificing the speed of your entire process for the ability to view progress. For very long processes, it would probably be worth the effort.

                      You would therefore be seeing this sort of message:
                      "300 of 1000 records completed"

                      ADDED COMMENT: This reminds me of how A5 displays pages and navigation links in a grid. A5 uses page numbers instead of start and end record numbers, but the logic is quite similar.
                      Last edited by agillbb; 01-30-2013, 09:01 AM.

                      Comment


                        #12
                        Re: Display message during processing records

                        Hi Andy,
                        I'm just playing around to see what can be done. I'm using a dialog just for testing purposes. I'm not too strong with JavaScript so a dialog is a nice sandbox.

                        My thoughts were to display a progress bar by changing the size of a div. It works pretty well by itself and so does the xbasic. Getting the xbasic to "report" to the JavaScript while it is running is the issue.

                        I guess what I am looking for, for lack of a better description, is a JavaScript callback from xbasic.

                        Comment


                          #13
                          Re: Display message during processing records

                          Jinx, you just pass the js callback code. To view this for any callback, in the action javascript screen click on view javascript (or similar). As mentioned above, your xBasic script will need to return you div-setting code followed by the callback code (once it is not the last callback).

                          Comment


                            #14
                            Re: Display message during processing records

                            Originally posted by agillbb View Post
                            Jinx, you just pass the js callback code. To view this for any callback, in the action javascript screen click on view javascript (or similar). As mentioned above, your xBasic script will need to return you div-setting code followed by the callback code (once it is not the last callback).
                            I'm looking for something to execute from the xbasic loop, during the loop, that sends back JavaScript....if such an animal even exists.

                            I tried:
                            ?"<script>" + mycommand + "</script>"

                            But that doesn't seem to do the trick, at least not within the loop.

                            Comment


                              #15
                              Re: Display message during processing records

                              Is there an a5.msgBox.Refresh() option?
                              Glen Schild



                              My Blog

                              Comment

                              Working...
                              X