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 Variables Never Work for me on the client side.

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

    Session Variables Never Work for me on the client side.

    I've tried and tried to get my client side expressions to recognize a published session variable and all I get is parsing errors and javascript errors.

    If I enter in SESSION.GROUP = "Administrators" into my hide/show expression I receive a "Error converting to Javascript". In my "Published Session Variables" I have: SESSION.GROUP

    I don't know if I'm doing something wrong or if I have a bug on my particular system but this is really annoying if I want to fine tune permissions.

    The only way I can get anything to work is to do it through the query like this:
    Code:
    SELECT blogcomments.commentid, blogcomments.entryid, blogcomments.userid, blogcomments.comment, blogcomments.approved, blogcomments.datetime, security_AllowedUsers.UserSecId, security_AllowedUsers.[First] AS [First], security_AllowedUsers.Last, :usergroup AS secgroup 
    FROM blogcomments blogcomments
    	 INNER JOIN security.AllowedUsers security_AllowedUsers
    		 ON  blogcomments.userid = security_AllowedUsers.Userid  
    WHERE approved = 1  OR (approved IN (0, 1, 2) ) AND  :usergroup = 'Administrators'
    I am able to set an argument to my session variable without an issue. I then need to pull it into a fake field so that I can get at it from the client side.

    Anyway, since I can get at it from the query I sure should be able to get at it by publishing it right?

    Any insight would be appreciated.

    UPDATE: the variable names, session.user and session.group appear to be no-nos. They seem to conflict with alpha's own session variables.
    Last edited by -Jinx-; 02-05-2013, 10:47 AM. Reason: SOLVED

    #2
    Re: Session Variables Never Work for me on the client side.

    Do you have session.group on the server-side?

    Comment


      #3
      Re: Session Variables Never Work for me on the client side.

      I have an included a5w page that has the username and group in it. If I can get it from my query I assume I have it server-side.

      Comment


        #4
        Re: Session Variables Never Work for me on the client side.

        I'd try something like this in the component:
        If variable_exists("session.CompanyID") = .f. then
        session.CompanyID = 11
        end if

        Comment


          #5
          Re: Session Variables Never Work for me on the client side.

          I have it on the server side.
          I put this in my OnTilesRender event:
          Code:
          dim js as c = ""
          dim usertest as c = session.user
          js = "alert('"+usertest+"');"
          e.javascript = js
          And I got an alert with the username

          In any case, where I really need this is my hide/show expressions. For some reason "Publish Session Variables" doesn't seem to transfer them over....OR my client side expression doesn't recognize them.

          Comment


            #6
            Re: Session Variables Never Work for me on the client side.

            I use session variables on the client side with the results I'd expect.

            Here's one of the expressions:

            SESSION.USERGROUPS = "Administrators"

            and in the published session variables dialog you'll find:

            SESSION.USERGROUPS

            Dunno if this will help or not, but works well.
            -Steve
            sigpic

            Comment


              #7
              Re: Session Variables Never Work for me on the client side.

              Originally posted by Steve Workings View Post
              I use session variables on the client side with the results I'd expect.

              Here's one of the expressions:

              SESSION.USERGROUPS = "Administrators"

              and in the published session variables dialog you'll find:

              SESSION.USERGROUPS

              Dunno if this will help or not, but works well.
              Steve,
              That's exactly what I've been trying but it won't work for me. Either I'm missing something stupid or it's a bug with my entire project.

              Could there be a setting I'm missing somewhere?

              Comment


                #8
                Re: Session Variables Never Work for me on the client side.

                Have you considered using state variables ?

                There is documentation that state variables work clientside and serverside.
                Gregg
                https://paiza.io is a great site to test and share sql code

                Comment


                  #9
                  Re: Session Variables Never Work for me on the client side.

                  Jinx, you could try using session variable names other than "user" and "group" in case A5 has an issue with these.
                  I don't know what component you are trying this with, but test a simple case: create a new simple grid, add a session var, publish it to clientside and use it in a show/hide - see if it works at this very basic level. It should, right?

                  Comment


                    #10
                    Re: Session Variables Never Work for me on the client side.

                    Greg,
                    I've heard of them and may use them down the road but I'd sure like to get the published session variables to work.

                    Andy,
                    That's a good thought and I'll give it a try. I've tried with grids and dialogs both.

                    On the same subject, you'd think that if alpha uses the security groups for permissions on buttons and such that there would already be some variable available on the client side containing the group and that you wouldn't need to publish a session variable or what-have-you. For something that has a potential to be used a lot you'd think they could make something easily available to us.

                    Comment


                      #11
                      Re: Session Variables Never Work for me on the client side.

                      Andy,
                      It appears that you had the right idea indeed!

                      I set:
                      session.stupidworthlessvariable = a5ws_get_user_assignments(a5ws_getcurrentuser())
                      in my included A5w page and then put this in my hide/show expression:
                      SESSION.STUPIDWORTHLESSVARIABLE = "Viewers"
                      and although you can see my frustration at the time of the naming of the variable. it turned out to be neither stupid nor worthless.

                      Now, if there's a conflict, and apparently there is; why can't we get at those two variables on the alpha side and not have to publish anything in the first place????

                      Comment


                        #12
                        Re: Session Variables Never Work for me on the client side.

                        Every language has reserved words, and I guess these are Alpha's for session vars? What more can be said?

                        Comment


                          #13
                          Re: Session Variables Never Work for me on the client side.

                          Here is what I use to capture user groups at login in to comma delimited strings I can use later (I left out how you get the filter vars):

                          if variable_exists("submitbutton")
                          session.allgroups = a5ws_get_groups(request,.f.)
                          [for v10]session.mygroups = crlf_to_comma(a5ws_get_user_assignments(session.__protected__ulink,request))
                          [for v11]session.mygroups = crlf_to_comma(a5ws_get_user_assignments(pUser.userid,request))
                          end if
                          Steve Wood
                          See my profile on IADN

                          Comment

                          Working...
                          X