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

Wait.. msg while Saving

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

    #31
    Re: Wait.. msg while Saving

    Change your code to:

    Code:
    ... <img src=\'CSS/A5System/images/wait.gif\'> ...
    Bob Moore


    Comment


      #32
      Re: Wait.. msg while Saving

      That works (still struggling with this JavaScript language)
      thank you (again)
      Cheers
      Mauricio

      Comment


        #33
        Re: Wait.. msg while Saving

        Okay, this method is not working for me!

        I have a non editable grid which shows different sections of an exam to be completed. Each section being a different record and therefore a different row on the grid.

        There is a button on each row which has 3 action javascripts tagged to the onClick event.

        1. Inline-Javascript which opens a message box
        A5.msgBox.show('Searching...','<div style=\'padding: 20px;\'>Please wait while we create the module questions...</div>','none',function() {});
        2. Ajax Callback which calls an InternalXbasicFunction which creates the personalised questions for the user. These questions are created in a different table. This script works perfectly.

        3. Open a Grid Component. This opens a grid in the exam questions table correctly filtered to show only the questions just created. It opens as a modal popup window

        Additionally I have placed
        A5.msgBox.hide();
        in the afterAjaxCallbackComplete Javascript System Event

        Now when I run this the message box appears but is immediately covered by the modal popup window which proceeds to open the grid component showing no records. THEN after the ajax callback finishes the message box is closed.

        I guess what I am saying is for my circumstances I need a form of WAIT command to STOP the grid component from opening UNTIL the questions have been created.

        I have tried a display message box in the action javascript and that DOES stop the grid component from opening until it is closed BUT if it is closed to quickly then only some questions display as all have not been created!

        To me this is such a basic requirement and I cannot believe it appears to be so difficult to solve!
        Glen Schild



        My Blog

        Comment


          #34
          Re: Wait.. msg while Saving

          Glen,

          If I'm following your logic correctly, you have assigned 3 different Action JavaScript actions to the button onClick event and you are expecting each action to complete prior to the next action firing. This is an assumption that you can't make. You need to make all of the associated steps essentially event driven.

          That is, upon completion of event1, call event2. Upon completion of event 2, call event 3.

          So in your case I would probably:

          1. Create a button to call the grid you want to display, using Action JavaScript to do the heavy lifting. Hide this button with conditional display logic, 1=0. It will never appear.

          2. In your button onClick event (Not the one you just created and hid above), Open the message box with JavaScript

          3. Make the Ajax callback that will populate the grid. If you are using a SQL backend, a stored procedure would work nicely here.

          4. When the callback completes, return the Javascript that will close the msgBox and call the onClick event of the hidden button. This should bring up the grid, filtered the way you want.

          Notice that we are controlling every aspect of the program flow, making it essentially a synchronous operation.

          There are other ways of doing this (define your own events and event handlers) but I think this is the easiest.

          I think that will work for you.
          Bob Moore


          Comment


            #35
            Re: Wait.. msg while Saving

            Bob

            Thanks for this, it makes sense although this is now showing up my weakness in javascript!

            I am struggling with the last part, namely the calling of the onclick event of the hidden button. I am assuming I can call the event from the afterAjaxCallbackComplete Javascript event immediately after the message box has been hidden.

            I have created a javascript function in the JavaScript function delarations property window.

            function opensesame(){
            {grid.componentName}_G__UNBOUND_BUTTON_6_1({grid.rownumber},'{grid.rowId}',this);
            }
            I have then added a line to the afterAjaxCallbackComplete event which now reads:

            A5.msgBox.hide();
            onclick=opensesame();
            When running the message box opens and then disappears but the grid is not opening.

            Nearly there!
            Glen Schild



            My Blog

            Comment


              #36
              Re: Wait.. msg while Saving

              Glenn and/or Bob,

              This is a very interesting thread. As you say Glenn, not all of us are at Bob's level of understanding javascript (few are) so if you would be so kind as to post the completed working script when you are done, that would be greatly appreciated!

              Good luck.

              Comment


                #37
                Re: Wait.. msg while Saving

                Glen,

                Using the afterAjaxCallbackComplete event is OK for testing but remember it will fire after EVERY callback (like a search, sort, submit, etc.), so you would need some kind of JavaScript variable that acts as a flag that is set in your ajax callback ( you could set the flag in JavaScript prior to making the callback if you want to go on blind faith that the callback did it's job .. not really a good idea) which you would test for in the afterAjaxCallbackComplete event and then clear if required. I think it's easier to do this as part of your Ajax callback.

                In any case, to fire a button's onClick event you will need to use something like :

                Code:
                $('{grid.componentName}.V.R{grid.rownumber}._UNBOUND_BUTTON_1').onclick();
                So in your case, this may work in your afterAjaxCallbackComplete event (again for testing only!):

                Code:
                try{
                  A5.msgBox.hide();
                  $('{grid.componentName}.V.R{grid.rownumber}._UNBOUND_BUTTON_6_1').onclick();
                }
                catch(e){
                }
                Last edited by Bob Moore; 04-13-2010, 12:09 PM.
                Bob Moore


                Comment


                  #38
                  Re: Wait.. msg while Saving

                  Hi Bob

                  Thanks for your help on this.

                  I am afraid it is still not firing!

                  Regards

                  Glen
                  Glen Schild



                  My Blog

                  Comment


                    #39
                    Re: Wait.. msg while Saving

                    Originally posted by Bob Moore View Post
                    There are a number of ways to do this.

                    You can use the AfterAjaxCallbackComplete event but it will fire after EVERY Ajax callback, that includes searches, sorts, etc. As such, I commonly use a state flag to determine when to initiate the appropriate code or for a more general approach you can use a JavaScript try .. catch statement without a state flag, however this is probably less efficient.

                    So let's say you have an A5 message box that you want to clear in the AfterAjaxCallbackComplete event. In the example below, using a state flag called my_ajax_function_complete_flag which you would set to true in your Ajax callback function, you could do something like this in the AfterAjaxCallbackComplete event:

                    Code:
                    if (my_ajax_function_complete_flag){
                       try { 
                         A5.msgBox.hide();
                       }
                       catch(e){
                       }
                       // clear create_flag
                       my_ajax_function_complete_flag=false;
                    }
                    This tests the state of the flag and attempts to hide the A5.msgBox if the flag is set, it then clears the flag.

                    Or for a more generic approach without using a state flag, you could do something like this. This will not throw a JavaScript error if the A5.msgBox is not displayed.

                    Code:
                    try { 
                      A5.msgBox.hide();
                    }
                    catch(e){
                    
                    }
                    The JavaScript try ... catch statement is a very useful tool and I use it often.
                    I have been fighting this A5.msgbox.show() for a couple days now. I am following the exampes, with the .SHOW in the CanSearchSubmit and the .HIDE() in the AfterSearchSubmit. In WorkingPreview, this works fine, as long as I'm just running the gird itself.

                    However, the Grid is normally run from a TabbedUI.
                    When I attempt to run the Grid from the TabbedUI (in livepreview), I get the following error FROM THE .HIDE(): --- the .SHOW seems to work fine.

                    Error has occurred in script on this page
                    Line 1203
                    Object doesn't support this property or method
                    URL localhost/livepreview/javascript/a5.js

                    (I also used the suggested Try ...Catch, and still get the same error in the TabbedUI)

                    Has anyone else had problems with the A5.msgbox in the TabbedUI?
                    Is there a way around this?

                    Thank you for your help, Kim
                    Last edited by kimhere; 09-22-2011, 12:58 PM.

                    Comment


                      #40
                      Re: Wait.. msg while Saving

                      I was incorrect, it is NOT the A5.msgbox.hide() causing the error in Internet Explorer.

                      It appears that IE does NOT like this statement that I am using for a dynamic Grid Column Label (which, by the way, works just perfect in Firefox):
                      (this is on the Grid Field Column Label)

                      <div id="muni_label"> </div>

                      Muni_label is defined in the AfterSearchSubmit:

                      var muni_label = ' ';

                      window['muni_label'] = {grid.object}._getValue('S','MUNI_CATEGORY')

                      if(window['muni_label']) muni_label = window['muni_label'];
                      else muni_label='';

                      $('muni_label').innerHTML = muni_label;

                      Comment


                        #41
                        Re: Wait.. msg while Saving

                        You have an object and a variable with the same name, that is a problem.
                        Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                        Comment


                          #42
                          Re: Wait.. msg while Saving

                          I'm not good at all with javascript.

                          I copied this from another message board somewhere, and have been using it successfully to dynamically set "titles", like above the detailview.

                          Are you referring to the (window[muni_label]) as being the object?
                          Honestly, I really don't understand the window[], but just know it was working for me elsewhere.

                          I will change the variable name and see if that helps.

                          Thank you for your help! Kim
                          Last edited by kimhere; 09-23-2011, 10:24 AM.

                          Comment


                            #43
                            Re: Wait.. msg while Saving

                            Originally posted by frankbicknell View Post
                            You have an object and a variable with the same name, that is a problem.
                            THANK YOU! I changed the window[] name, and works like a charm. Kim

                            Comment


                              #44
                              Re: Wait.. msg while Saving

                              Hi Bob,

                              I'm using the latest V11. I have a simple grid with a detail section. In the AfterInsertRecord server-side event, I have some cose which needs to run and it takes about 3-4 seconds. However, that is a bit too long to wait for some people, so I have to do something like a PleaseWait function.

                              I can't discover how to use this command in this context. Does it work in V11? If so, where to place it?

                              Thanks,

                              Charlie

                              Comment


                                #45
                                Re: Wait.. msg while Saving

                                Originally posted by christappan View Post
                                Only because I saw another video do I have any response to your question, and I would welcome anyone more seasoned at this to give additional info.

                                I'm using detail views in most of what I'm soing--it would be slightly different using editable grids. What I've done is put a div in the freeform region under my detail views called 'msg'.

                                Then, in the Grid Properties Javascript - System Events, I have the following code:

                                AfterDetailViewCancelEdits:
                                $('msg').innerHTML = 'Edits Undone.';
                                setTimeout ( '$(\'msg\').innerHTML = \'*\';', 2000 );

                                AfterDetailViewSubmit:
                                $('msg').innerHTML = '';

                                CanDetailViewSubmit:
                                $('msg').innerHTML = '<img src=\'CSS/A5System/Images/wait.gif\' /> Please Wait - Validating and Saving...';

                                What I'd like to add/change is to have a modal window popup while saving so the save button can't be re-hit. That, or at least a disabled save button until the record is saved.

                                Thanks in advance for more ideas on this...
                                Chris:

                                Is the above still working for you? I can't seem to get it quite right on my end using V11.

                                Thanks,
                                Charlie

                                Comment

                                Working...
                                X