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

session variable trap

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

    #31
    Re: session variable trap

    It was my pleasure.

    BTW, I was speaking with another Alpha developer about this issue today and he thought we might be able to use the OnRowRender client event to initialize the ID from the Javascript side of things (i.e from the Javascript global variable approach we discussed earlier in this thread), and avoid the call-back to set the session variable. The only proviso is that you would need to check the row number and make sure it was < 0 before doing the setValue(), as row numbers for new records in the grid are negative. I.e. :

    var rowNum = {grid.Object}._selectedRow;
    if (rowNum < 0) {
    // put the setValue() initializing code here...
    }

    We haven't tested this out but we think it should work.
    Last edited by cFlat7; 11-08-2011, 11:12 PM.

    Comment


      #32
      Re: session variable trap

      *deleted by author*

      Comment


        #33
        Re: session variable trap

        Vaughn,

        i was reading this older post and it is very clear what your telling. I have a simular situation except i only need the session var on child grid.
        So it looks to me i have a timing issue (it looks like when i wait long enough the correct session var is available). You mentioned in this thread there is a way to overcome this. Can you pls point me in the good direction?

        Comment


          #34
          Re: session variable trap

          Yes, Alpha recently added a new feature that makes this quite easy. Have a look at video #M41 here:

          http://news.alphasoftware.com/v11preview/videos_v11.htm

          Comment


            #35
            Re: session variable trap

            I noticed that but sadly enough i need it vor v10.5 (i think it is a good improvement)
            It looks like they don't have a timing problem anymore? But in 10.5 with the ajax callback i have a tim ing problem. I set the session var and check with a log file (like your example) and it is set everytime correct. But when i want to use it on a childgrid (new record) it is not always there. Sometimes it is fast sometimes not. Don't know why. i think the timing problem. I don't know how to speed up the session var to be available for the childgrid or just disable the new record functionality until the session var is available (with the correct value)

            Comment


              #36
              Re: session variable trap

              Marc,

              In version 10.5, the only sure-fire way I know of is the following (forgive me if I'm repeating from a previous post):

              1. In the parent grid, create two buttons, one of them will do the call back to set the session variable. The other button will call your child grid; also, make this button hidden (so your user only sees the button that does the Ajax callback).

              2. In the Xbasic of the Ajax callback that sets the session variable, have it send back a Javascript command to click the hidden button that will call your child grid. For example:


              myXBasicFunction = "{Grid.ComponentName}_BUTTONS_CALLCHILDHIDDEN.onClick();"

              ...where the name of your button (as per the button definition) is after _BUTTONS_, in this example the button is called CALLCHILDHIDDEN (and the Xbasic function is called myXBasicFunction).

              This way the child grid does not get called until after the callback has completed, ensuring that the session var has been set before the child gets access to it.

              One thing else to watch out for, and that is that when the child grid is rendered it takes a "snapshot" of the value of any session vars it is using the first time the child grid is opened. To avoid that, so the child grid sees the changed value of the session var, in the parent grid make sure that the "Use Cached Grid" property is clicked off (in the Action script dialog for calling the child grid).

              I hope this helps,
              Vaughn

              Comment


                #37
                Re: session variable trap

                Hi Vaughn,

                thanks for your help . It made a lot of things clearer to me (especially that it takes a 'snapshot' and the cache grid part). The only thing i can't get working is to 'push' the hidden button with the xbasic. maybe i have the name of the button wrong (just button 15) -I also tired the button label name-.
                I end my XBasic function with: XB_set_Upload = "{Grid.ComponentName}_BUTTONS_UNBOUND_BUTTON_15.onClick();" but that doesn't seem to 'push' the hidden button. If i put in XB_set_upload = "alert('test screen ');" i get the message so the Xbasic funtion is executed.

                Comment


                  #38
                  Re: session variable trap

                  My example was using the Name property of an Action button. Is 'Button_15' the name you used in this property? I'm assuming you are putting the button in the tool bar in above/below the grid.

                  Comment


                    #39
                    Re: session variable trap

                    I used a button on the detailview

                    Comment


                      #40
                      Re: session variable trap

                      I use now: XB_set_uploadfolder = "ele=$('{Grid.ComponentName}.D.V.R1._UNBOUND_BUTTON_15');ele.click();"
                      that works partially. If i check it in live preview (or check that page in browser) button 15 is pushed at the end of the callback. So theoretically that should take care of my session vars timingproblems. So far thank you again for taking the time to show me how things work.
                      Strange thing is that if i check on localhost or live on the Inet button 15 is not pushed at the end of the callback.
                      So it looks like the java that is send to the browser is not good. Ionly wonder why it does work in live preview (and also under the browser)

                      Comment


                        #41
                        Re: session variable trap

                        Marc, I'm not sure why that would not work in the browser. Perhaps others in the forum might have an idea.

                        p.s. It is too bad you can't use v.11. With the feature shown in video M41, you simply "register" any session variables you need in the Action script dialog for calling a grid. There is no timing issue as Alpha sets the session variables on the server before calling the child grid.

                        Comment


                          #42
                          Re: session variable trap

                          One other thought... if you provide the link to the child grid from the grid (e.g. in an action button), instead of from the detail view the syntax I posted earlier should work.

                          Comment


                            #43
                            Re: session variable trap

                            Hope i can switch to v11 soon but for now i have to solve this issue with v10.5
                            thanks for your help

                            Comment

                            Working...
                            X