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 set session variables from a List Control (UX)

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

    How to set session variables from a List Control (UX)

    Trying to figure out how to set session variables from the List Control properties. I've tried doing it from the List Properties -> Java Script Runtime -> OnItemDraw
    and a few other places that were just guesses on my part. Looked in the documentation and the help videos but haven't spotted anything that walks you through the best way to set/create session variable from a UX using fields from a List Control to populate the session variables

    In the past, I've been doing this from a grid using the Server Side Event -> OnExistingRowRender to create and populate session variables

    Example of my old way
    function OnExistingRowRender as v (e as p)
    dim e.rv.session.__protected__user_email as c
    dim e.rv.session.__protected__greeting as c
    dim e.rv.session.__protected__company_code as C
    dim e.rv.session.__protected__company_name as C
    dim e.rv.session.__protected__company_address1 as C
    dim e.rv.session.__protected__company_address2 as C
    dim e.rv.session.__protected__company_city as C
    dim e.rv.session.__protected__company_state as C
    dim e.rv.session.__protected__company_zip as C
    e.rv.session.__protected__user_email = e.rowData.data("userid")
    e.rv.session.__protected__greeting = e.rowData.data("greeting_name")
    e.rv.session.__protected__company_code = e.rowData.data("company_code")
    e.rv.session.__protected__company_name = e.rowData.data("company_name")
    e.rv.session.__protected__company_address1 = e.rowData.data("address1")
    e.rv.session.__protected__company_address2 = e.rowData.data("address2")
    e.rv.session.__protected__company_city = e.rowData.data("city")
    e.rv.session.__protected__company_state = e.rowData.data("state")
    e.rv.session.__protected__company_zip = e.rowData.data("zip")
    end function

    I really held off learning how to build UX components and am starting to appreciate all the cool things you can do, but just haven't been able to figure this out. Any suggestions are much appreciated

    Environment.... AA Build 3779-4708 Windows Server 2008 r2 and SQL Server 2008 r2

    Thanks, Dave

    #2
    Re: How to set session variables from a List Control (UX)

    __protected and e.rv are no longer required... Alpha recommends using the Session object... e.g. session.user_email="[email protected]". Further... session vars do not need to be dimmed.

    I'll use session vars in a web app, but not usually in a mobile app. There are also State vars you can use which are easily accessible client and server side. Are you working on web or mobile?

    To set session vars... you can perform an Ajax Callback from the client to the server. All data is usually in e.dataSubmitted.

    If you're working with a data bound UX, then the server-side events can be used... access the data... and set your session vars.

    Overall, it kinda depends on what you need to do... and where.

    Comment


      #3
      Re: How to set session variables from a List Control (UX)

      David, can you give an example of setting a state var from a SQL lookup? Second question: would this be preferable to a session var? Third, which is more secure?
      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

      Comment


        #4
        Re: How to set session variables from a List Control (UX)

        Setting a state var, in principle, is like setting a session var. e.g. e._state.myVar1 = "value1". You can find this info in the UX server-side events doc. Preferable? Depends on what you're doing and where you're doing it. I prefer not to use session vars in mobile apps. I'd rather use state vars and dialog namespace vars. More secure? No more or less I'd suppose.

        Comment


          #5
          Re: How to set session variables from a List Control (UX)

          Ok, I have seen you say it more than once about state vars in mobile apps and I guess that is because of the server relationship with the app possibly not being present whereas a web app almost always means your connected by nature of the fact that your "on" the web.
          Because my web application is multi-tenant I filter about all of my components by a session var called company_id. When I build a phone gap application I should probably change the "session.coid" to "e._state.coid" and filter all of my components by that instead. I don't want to do that because you said so, I want to do it because I understand WHY I would do that and what benefit it brings or what posible issues I might have by not doing it.
          Do you find they are more reliable? Faster? etc...
          Finally, I am really only asking for a better understanding and thank you in advance.
          Always a major help!
          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

          Comment


            #6
            Re: How to set session variables from a List Control (UX)

            I know your knee-jerk reaction would be to say "does this guy even read the documentation on variables?"
            I promise I have read it several times, I read the footnotes and tips and bought books and watch the videos! I work with Alpha every day. Somehow, you make it real to me when you explain it. Not everytime mind you - but very often ---- so many thanks!
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #7
              Re: How to set session variables from a List Control (UX)

              The app I'm working on is for mobile and the old sample code goes back to version 10. I was trying to show where I was coming from, ie: old way versus new way.

              Thanks for the advice about avoiding the use of session vars in mobile apps. As the app has been growing, I've become more concerned about how the life span would behave while disconnected

              I came across state vars in some of the documentation, but really couldn't put 2 and 2 together, will need to re-visit

              Comment


                #8
                Re: How to set session variables from a List Control (UX)

                Originally posted by CharlesParker View Post
                I know your knee-jerk reaction would be to say "does this guy even read the documentation on variables?"
                I promise I have read it several times, I read the footnotes and tips and bought books and watch the videos! I work with Alpha every day. Somehow, you make it real to me when you explain it. Not everytime mind you - but very often ---- so many thanks!
                Ummm... you're welcome?

                Comment

                Working...
                X