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

    #16
    Re: Display message during processing records

    It doesn't work this way. You send your js response at the end of the callback.
    I think you should read through my earlier post carefully....and read up on callbacks. A5 actually gives you tips within the callback function protocol when you create a callback. Good luck...

    Comment


      #17
      Re: Display message during processing records

      Originally posted by agillbb View Post
      It doesn't work this way. You send your js response at the end of the callback.
      I think you should read through my earlier post carefully....and read up on callbacks. A5 actually gives you tips within the callback function protocol when you create a callback. Good luck...
      I did read and understand your earlier post. You have always been quite helpful, so I pay attention. ..haha.
      I also haven't been clear with exactly what I'm doing since I'm not near my computer it's hard to remember and then type my code with my cell phone.

      Anyway, your last post confirms what I've been experiencing. I was just hoping there WAS a way to pass data back through every loop in the xbasic. I tried breaking up xbasic code in separate a5 tags on an a5w page and that didn't work either.

      Comment


        #18
        Re: Display message during processing records

        Jinx,

        What is the purpose of this long operation? Is it more of a standalone job or an intermediate synchronous operation which must be performed to bring up a web page/component or report?

        Comment


          #19
          Re: Display message during processing records

          Hi Dave,
          The OP was the one doing this long operation. I'm just trying to figure out a progress tracker of some sort as an exercise. I don't particularly need one myself at the moment but it would be nice to get something to work in case I did later.

          I figured this would be a good thread to do it in as if someone came up with a solution it would help the OP.

          Comment


            #20
            Re: Display message during processing records

            OK, to be more clear with what I'm playing with currently:

            I have a dialog (just because it makes an easy platform to test with)
            In that dialog I have an HTML container with this code:
            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>
            Currently I have a textbox field named pcent as well that has this code in it's onChange event:
            Code:
            var p = {dialog.object}.getValue('PCENT');
            
            function setPercentage(id, percent)
            {
            var div = document.getElementById(id);
            div.style.width = percent + "%";
            }
            
            setPercentage("bar",p);
            So, if I type something into the value or set it my little green bar moves across the screen via changing the inner div's width.

            I have an Xbasic function that I'm trying to drive this with. As Andy told me above though, it's probably impossible since there doesn't seem to be a way to throw code back to the javascript side WHILE the loop is running in Xbasic. It only throws the code out at the end.

            That looks something like this for testing purposes:
            Code:
            function testProgressBar as c (e as p)
            	dim vjscmd as c
            	dim percent as n = 1
            	dim progress as c
            	dim result as C
            	dim con as SQL::Connection
            	dim args as SQL::Arguments
            	if con.open("::Name::MVWKS")	then
            			dim sqlCommand as c = "SELECT * FROM [tooling card info]"
            				if con.Execute(sqlCommand,args) then
            					dim rs as SQL::ResultSet
            					rs = con.ResultSet
            					'result = con.CallResult
            						if rs.NextRow() then
            							while rs.NextRow()
            								percent = percent + 1
            								progress = "{dialog.object}.setValue('PCENT',"+percent+");"
            								updateProgress(e, progress)
            								'?"<script>" + progress + "</script>"
            								'debug(1)
            							end while					
            						else
            						vjscmd = "alert('No record found');"
            						end if	
            				else
            			   vjscmd = "alert('Execute Error: Error returned was: " + js_escape(con.CallResult.text) + "');"
            	         end if			
            							
            	else
            			vjscmd = "alert('Connection Error: Error returned was: " + js_escape(con.CallResult.text) + "');"
            	end if
            	
            end function
            
            function updateProgress as c (e as p, progress as c)
            'debug(1)
            ?"<script>" + progress + "</script>"
            	'UpdateProgress = progress	
            
            end function
            You can see that my latest attempt was to try to use nested functions which didn't work either...haha.


            Andy's idea would work and I might play with it a little later. I'd have to somehow come up with a function that takes care of it though because it would suck to have to program that every single time you wanted to use a progress bar. It would probably need to be some javascript function that makes use of it's own loop to fire the multiple callbacks. I'll see.

            Comment


              #21
              Re: Display message during processing records

              Jinx, you're making this painful...hang on, let me just code it for you and whoever may wish it....

              Comment


                #22
                Re: Display message during processing records

                Originally posted by agillbb View Post
                Jinx, you're making this painful...
                It wouldn't be the first time!
                Originally posted by agillbb View Post
                hang on, let me just code it for you and whoever may wish it....
                That would be greatly appreciated. Maybe I'm not seeing it clearly.

                Comment


                  #23
                  Re: Display message during processing records

                  Ok, here's the progress bar that would be useful for large callback processes. Darn, took 3/4 of my lunch hour.
                  CallbackProgress.a5wcmp

                  Comment


                    #24
                    Re: Display message during processing records

                    Thanks Andy,
                    I've got to play a bit to understand everything BUT..... I did learn one thing by messing with your dialog: On my system and alpha build, it's pretty much impossible to pass a variable with the ajax callback action javascript. I just doesn't get transfered in. No wonder I was having issues getting stuff to work and ended up relying on a5w pages all the time instead of xbasic functions.

                    Your dialog pointed to me in the right direction since your button was using text mode. If I convert the action javascript for an ajax callback to text it works with no issues. The variable is transfered into the xbasic function.

                    Comment


                      #25
                      Re: Display message during processing records

                      First: please have mercy of me, because I'm not accustomed with javascript, Ajax, and asynchronous code.

                      But this was my think: can't be that the xbasic loop writes to a session variable (or more than one) and a piece of software (client side js, or whatever) go and check asynchronously that session variable(s) and use the data for the progress indicator?
                      Hourly rate: 50 - If you look: 60 - If you laugh: 70 - If you tried yourself before: 100

                      Comment


                        #26
                        Re: Display message during processing records

                        Hi, I guess it could work, and you could perform a simple test case to confirm. There are always many ways to skin a cat.

                        Comment


                          #27
                          Re: Display message during processing records

                          you can have the xbasic function writing out to an xml file and have the javascript function periodically reading that xml file.

                          The javascript function would be called using the setInterval() method just before the AJAX call to the xbasic function.

                          http://www.w3schools.com/js/js_timing.asp
                          http://www.w3schools.com/xml/xml_http.asp

                          Comment


                            #28
                            Re: Display message during processing records

                            Found this article at: http://www.learn alpha.com/WAS_Progr..._Progress.html

                            It is dated 2005 and uses thread_create() and thread_variables() but it may be still working.

                            Three version: a simpler % of completion, a graphical bar, and also a "terminate" button
                            Hourly rate: 50 - If you look: 60 - If you laugh: 70 - If you tried yourself before: 100

                            Comment


                              #29
                              Re: Display message during processing records

                              You could have the xbasic function write out records processed to an xml file that a javascript function is reading from.

                              The javascript function would be launched with a setinterval() or simply launched before firing the xbasic function.

                              http://www.w3schools.com/js/js_timing.asp

                              Comment


                                #30
                                Re: Display message during processing records

                                I have a solution. Anyone who wants to help me beta test it please email me at [email protected]. Thanks.

                                Addendum: I see this post is in V11 thread. My solution has been developed and tested in AA (V12), but it should run in V11 if you want to try it.
                                Last edited by Jeff Benson; 10-20-2013, 05:20 PM.

                                Comment

                                Working...
                                X