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

Timing arrrrrggggg

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

    Timing arrrrrggggg

    I have read and read about timing. I understand calls to Xbasic are slow. Ajax callbacks are async.
    But I did read that you could do a callback to xbasic, do whatever in xbasic and include javascript in the return string. As I understand it, the javascript would be executed after the xbasic was completed.

    I am trying to do this on a onclick event of a grid button:

    function Set_Session_Variables as c (e as p)
    'debug(1)

    session.lastname = e._currentRowDatanew.lastname
    session.firstname = e._currentRowDatanew.firstname

    set_session_variables="window.open('http://localhost/CLientDetailTabbedPage.a5w',,width=800,height=600)"


    The session variables are DIMed at the initialization of the current grid.
    The problem is that when the target page is rendered, which has the two session variables output when the target is rendered, that sometimes the session variable has been updated and more than likely, it has not. And surprisingly, sometimes when i refresh the page, it does not pick up the new value - but maybe a refresh does not re-render.

    What am I missing?

    bob
    Bob Alston
    -------------------------------------------------------------------
    http://webpages.charter.net/bobalston/bob1.htm
    Alpha five v11 Tips

    #2
    Re: Timing arrrrrggggg

    Did you try using javascript setTimeout?
    Usage (thanks w3school): var t = setTimeout("javascript statement",milliseconds);
    You can see it here: http://www.w3schools.com/js/js_timing.asp

    Jaime

    Comment


      #3
      Re: Timing arrrrrggggg

      No effect except to slow things down.
      Interesting is that in IE, if I subsequently press the browser refresh, the correct data then shows up. If I do that with Chrome, no change.

      bob
      Bob Alston
      -------------------------------------------------------------------
      http://webpages.charter.net/bobalston/bob1.htm
      Alpha five v11 Tips

      Comment


        #4
        Re: Timing arrrrrggggg

        That's a caching issue in Chrome, got bitten by that one yesterday :-)
        Try first to see if it's not a logical issue, i.e put an "alert('im going for coffee");" before your set_session_variables=..., go really take that coffee (although in Dallas, i think now is the time for a nice drink before bed) then click to see what happens :-) If it still doesn't work, then i don't know...

        Comment


          #5
          Re: Timing arrrrrggggg

          But it doesn't work right in IE.
          Bob Alston
          -------------------------------------------------------------------
          http://webpages.charter.net/bobalston/bob1.htm
          Alpha five v11 Tips

          Comment


            #6
            Re: Timing arrrrrggggg

            Maybe you could do it with the 'window' namespace and do it all in javascript. There is a video about passing variables that covers this.
            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


              #7
              Re: Timing arrrrrggggg

              I wonder what would happen in you split into 2 Xbasic functions. First function sets session variables and returns a call to 2nd function. 2nd function opens the window. I've had some luck solving timing issues by doing that. (can't explain why, just that it has worked for me)

              FirstFunctionName = "{grid.Object}.ajaxCallback('G',{Grid.RowNumber},'SecondFunctionName','','_getData=true');"
              ---------------------------------------------------------------------------------------------------------------------------------------------------
              Another thing I do quite often is create a 'hidden' button to open a page (or grid in window). Hide it by putting 1=2 into Show/Hide Expression of the button. MUST NOT check the Hide box of the button or the call to its OnClick from Xbasic function will not work. Then the first unhidden button does ajax callback to an Xbasic function to set session variables and returns a call to the OnClick event of the second hidden button.

              EXAMPLES OF CALLING ONCLICK EVENT OF A BUTTON FROM XBASIC FUNCTION (will need to substitute appropriate BUTTON_? number):

              If on a dialog component:
              FunctionName = "$('{dialog.componentname}.V.R1.BUTTON_1').click()"

              If on a grid (not detail view): (this syntax recommended by Selwyn)
              FunctionName = "var ele = $('"+e.tmpl.componentname +".V.R{grid.rowNumber}._UNBOUND_BUTTON_5');ele.click();"

              If on a detail view:
              FunctionName = "var ele = $('" + e.tmpl.componentName + ".D.V.R1._UNBOUND_BUTTON_3');ele.click();"
              Carol King
              Developer of Custom Homebuilders' Solutions (CHS)
              http://www.CHSBuilderSoftware.com

              Comment


                #8
                Re: Timing arrrrrggggg

                Thanks Carol. I had heard of a "hidden button" approach but never the details. Appreciate it.

                bob
                Bob Alston
                -------------------------------------------------------------------
                http://webpages.charter.net/bobalston/bob1.htm
                Alpha five v11 Tips

                Comment


                  #9
                  Re: Timing arrrrrggggg

                  Search this news group for posts around the time of Jan 19, 2012. There was a solution posted for a session variable caching problem that sounds like your description. The solution involved putting a CONTENT="no-cache" in a META tag.

                  Also, if you are on a build prior to 2834 there was a problem with calling "DIM session.var". The fix was documented in the release notes, but I don't know if those notes are still available.

                  I have never been able to get session variables to work the same between Working Preview mode and real server mode. Not even after the so-called "fix". So, I only use them for capturing variables established during the login process.

                  Comment


                    #10
                    Re: Timing arrrrrggggg

                    Found my problem. It wasn't timing, it was ME. Emphasis on "my" problem.

                    I had mistakenly left in the 2nd actionscripting command after the call back to xbasic that had the change to the new window. that is why in IE, after the new page displayed, if I pressed refresh, I got the page WITH the correct session variables displayed.

                    thanks to A5 for providing assistance as they researched this in my bug report.

                    Note it is best, to avoid creating a new session, to use window.location instead of window.open.

                    thus the xbasic code would be:

                    function Set_Session_Variables as c (e as p)
                    debug(1)
                    session.lastname = e._currentRowDatanew.lastname
                    session.firstname = e._currentRowDatanew.firstname

                    Set_Session_Variables = "window.location = 'CLientDetailTabbedPage.a5w';"

                    Bob
                    Last edited by bobalston; 03-07-2012, 11:34 PM.
                    Bob Alston
                    -------------------------------------------------------------------
                    http://webpages.charter.net/bobalston/bob1.htm
                    Alpha five v11 Tips

                    Comment


                      #11
                      Re: Timing arrrrrggggg

                      Subsequent to getting this to work, I found that the apparently preferred method of linking to a new page such as this is to use built in a5 capabilities as outlined in the three part videos #38. Video m42 also shows how to obtain the argument, apparently a page variable, and use it in a page heading.

                      Bob
                      Bob Alston
                      -------------------------------------------------------------------
                      http://webpages.charter.net/bobalston/bob1.htm
                      Alpha five v11 Tips

                      Comment

                      Working...
                      X