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

How To Code MsgBox

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

    #16
    Re: How To Code MsgBox

    You CAN use it in a script. e.g. in System Events, and the script naturally pauses at the confirm box. When the user clicks OK or Cancel you can direct the flow of the action accordingly. No problem. What you can't do (or at least I can't think of a way) is to use the confirm box as the "return" to an xbasic callback function. The function returns the confirmbox which returns "ok" (actually true or false). Now what? There is no way to direct the output. If you tag another callback function after the first, it's too late. Both functions run asynchronously. That's the client-server dilemna. Once this is clear to you, you will think differently about the problem.
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com


    Comment


      #17
      Re: How To Code MsgBox

      Peter, Thank You.

      Result of this investigation.... I don't think I'd ever be able to convert my Custom Homebuilders' Solutions software to a web app. If you just watch the 2 videos on this page (http://www.chsbuildersoftware.com/Pa...es_Checks.html) about Post Job Costs, Parts 1 and 2, you'll see what I would be up against. Just notice how many times I check for things and pop up messages that then trigger other things. You have to watch for awhile to see the really active pop up stuff happening.

      What I've been describing in this thread is just one tiny tip of a huge iceberg.
      Carol King
      Developer of Custom Homebuilders' Solutions (CHS)
      http://www.CHSBuilderSoftware.com

      Comment


        #18
        Re: How To Code MsgBox

        Yes, Carol. You have a very sophisticated application there. It's not the kind of program that I would want to convert to a web app as my first project w. Alpha. Could it be done? Sure. But you would need to change methodology in many places to accomplish the same thing as what you have now. Neither easy nor simple by any means - but rather, a major undertaking.
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #19
          Re: How To Code MsgBox

          Yep, if I do anything with Alpha, I'm now coming to the conclusion that it can only be a 'CHS Web Buddy' that lets builders do simple lookups of info they have in CHS, and maybe some small things like giving their home buyers and subcontractors a place to review builder authorized info from CHS.
          Carol King
          Developer of Custom Homebuilders' Solutions (CHS)
          http://www.CHSBuilderSoftware.com

          Comment


            #20
            Re: How To Code MsgBox

            Originally posted by Peter.Greulich View Post
            ...What you can't do (or at least I can't think of a way) is to use the confirm box as the "return" to an xbasic callback function.
            Seriously, I'm going brain-dead. You CAN do this. The trick is to call a JS function with the confirm dialog, which in turn executes (or not) an xbasic callback function. Whew!
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #21
              Re: How To Code MsgBox

              Well, Peter, I was thinking that if Selwyn could do the coding he gave that has the alert box in it, and then have some coding after it, then what we were concluding about being thrown out of the code once the box was called was not making sense.

              So, is that what he did? Call a JS function? in his code for the alert box (see below). And now we're back to (full circle), how do I do the same thing with the confirm box and use the result? Am I supposed to create JSconfirmBox somewhere first?

              The first section below is me trying to use the confirm box. The 2nd section is me trying to figure out what to use as the result for an if statement. Within the if statement in the 2nd block of code below is code from Selwyn for the alert box and it DOES WORK.

              dim confirmMsg as c
              confirmMsg = "Press OK to confirm the delete."
              confirmMsg = js_escape(confirmMsg)
              'Do I need to dim the JSconfirmBox? As what?
              JSconfirmBox = "confirm('" + confirmMsg + "');"

              'If I can ever get the confirm box to pop up, can I grab its result?

              If JSconfirmBox = "false" then
              'user did not click ok to confirm the delete
              cn.Close()
              dim msg as c
              msg = "The record has not been deleted per your request."
              msg = js_escape(msg)
              dim jscmd as c
              jscmd = "alert('" + msg + "');"
              LookupInChildTablesThenDeleteIfNotFound = jscmd
              exit function
              end if
              Carol King
              Developer of Custom Homebuilders' Solutions (CHS)
              http://www.CHSBuilderSoftware.com

              Comment


                #22
                How To Code MsgBox - an In-depth Example

                Here is an in-depth example of how a server-side event can prompt the user for confirmation. See video number 85.

                http://news.alphasoftware.com/v10preview/videos.htm

                I hope that the videos make it clear that if server side code wants to prompt the user for any type of input, this has to be done in Javascript on the client-side. The server side code needs to CONSTRUCT the Javascript commands that prompt the user for input and then send these commands to the browser where they will execute.

                The Javascript commands will then prompt the user for input, and then depending on the input, will initiate another callback to the server to continue processing.

                It is clearly more complex than a desktop application where you don't have to think about client-side and server-side code execution. But once you 'get it' you will find that it not difficult to code.

                With regard to Carol's comments that her Access app is too complex to convert to a Web application, I disagree strongly. The videos she has show us of her app show forms that have a lot of 'rules' on them that govern what the user can and cannot do, but there is nothing she has shown that does not have a web analogy.

                Comment


                  #23
                  Re: How To Code MsgBox

                  Hi Selwyn - I am SO excited to watch the videos and very impressed that you have pursued this. One problem, though, all seven of the links point to the very same video. I can only imagine how tired it made you to do this, so I completely get why that would happen at the end of your hard work. I look forward to viewing these tomorrow. Bed time now or I'd try changing the end of the url address in my browswer to Part2, Part3, etc. and probably find the other videos.

                  THANK YOU, THANK YOU, THANK YOU!
                  Carol King
                  Developer of Custom Homebuilders' Solutions (CHS)
                  http://www.CHSBuilderSoftware.com

                  Comment


                    #24
                    Re: How To Code MsgBox

                    Originally posted by kingcarol View Post
                    Hi Selwyn - I am SO excited to watch the videos and very impressed that you have pursued this. One problem, though, all seven of the links point to the very same video. I can only imagine how tired it made you to do this, so I completely get why that would happen at the end of your hard work. I look forward to viewing these tomorrow. Bed time now or I'd try changing the end of the url address in my browswer to Part2, Part3, etc. and probably find the other videos.

                    THANK YOU, THANK YOU, THANK YOU!
                    ok, i fixed the links. sorry about that.

                    Comment


                      #25
                      Re: How To Code MsgBox

                      Selwyn - Those videos are outstanding and I'm going to get started implementing that confirm box and doing the 2nd callback. If that's successful, I might also get carried away and try out the javascript Prompt box to have the user enter their name and see if I can capture it to append a record to my back end audit table that tracks deletions and who executed them. (of course, once we're live I probably won't need to do that since I'll probably be able to somehow get the user's id from their login. just want to play with the prompt box.... OH NO! :)

                      I'll play with just the confirm and doing 2nd callback until it's successful, though.

                      Can you email me the grid you used for the videos again? Or provide it here as a download for all viewing this thread? I'd like to copy some of your comments into my code for future reference.

                      And thank you for the info about right clicking on the Action Javascript for the button to see the script for executing the callback from the grid. I'd already been clicking the Type radial button to try to look at that, but the right click makes it so much handier.

                      I think this info alone opens up a whole new world for me in thinking about a future conversion of CHS into a web app.
                      Carol King
                      Developer of Custom Homebuilders' Solutions (CHS)
                      http://www.CHSBuilderSoftware.com

                      Comment


                        #26
                        Re: How To Code MsgBox

                        if you go back to the videos page, there is now a link after the link to the 7 videos to download the component.

                        Comment


                          #27
                          Re: How To Code MsgBox

                          Selwyn - When that confirm box returns false(ie, user clicked to cancel the delete , do we need to close the connection that was opened? I noticed the cn.close is not in the Else part of the javascript. If we do need to close the connection, where do we put the cn.close... inside or outside of the confirm box javascript stuff?
                          Carol King
                          Developer of Custom Homebuilders' Solutions (CHS)
                          http://www.CHSBuilderSoftware.com

                          Comment


                            #28
                            Re: How To Code MsgBox

                            Originally posted by kingcarol View Post
                            Selwyn - When that confirm box returns false(ie, user clicked to cancel the delete , do we need to close the connection that was opened? I noticed the cn.close is not in the Else part of the javascript. If we do need to close the connection, where do we put the cn.close... inside or outside of the confirm box javascript stuff?
                            actually, the first callback should close the connection before it sends the javascript response to the client.

                            so there is no need to close the connection if the user cancels because it is already closed.

                            if the user clicks OK in the confirm box, a new callback is initiated and that callback opens its own connection to the database.

                            in other words each callback is completely atomic - it is responsible for opening and closing its connections. you can't 'share' a connection between callbacks.

                            Comment


                              #29
                              Re: How To Code MsgBox

                              OK, that makes sense about the callback closing the connection on its own before the javascript is sent to client. I had just noticed that you did do the cn.close before the code that used the javascript alert box earlier in the code before exiting the function and stopping. So I thought it might also be necessary with the return of false on the confirm box, since false from the confirm box will cause exit of the function without the second callback being made.
                              Carol King
                              Developer of Custom Homebuilders' Solutions (CHS)
                              http://www.CHSBuilderSoftware.com

                              Comment


                                #30
                                Re: How To Code MsgBox - an In-depth Example

                                Originally posted by Selwyn Rabins View Post
                                Here is an in-depth example of how a server-side event can prompt the user for confirmation. See video number 85.

                                http://news.alphasoftware.com/v10preview/videos.htm
                                FYI: At the time of this post, the above link is dead.

                                With regard to Carol's comments that her Access app is too complex to convert to a Web application, I disagree strongly.
                                I didn't say it couldn't be done. Just that I wouldn't want to attempt that as my first Alpha web app. Carol's application is VERY complex and quite sophisticated. From my point of view it represents a challenge, not an obstacle. Any project that daunting can be chipped away at one step at a time. Not to mention that Carol clearly is a very skilled programmer.
                                Peter
                                AlphaBase Solutions, LLC

                                [email protected]
                                https://www.alphabasesolutions.com


                                Comment

                                Working...
                                X