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

Help with passing user info among pages/dialogs

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

    Help with passing user info among pages/dialogs

    I need some help. I have a desktop application that is working, and I am trying to develop a web interface for it. It will operate as both a desktop and web interface. My problem I am having is that I can not seem to get the logged in user information to follow the different dialog/pages. I am using the A5 security component for the login. My DB has a user select an event and if they wish, sign up for that event. It consists of 4 tables, person (personal info), event(events available), linktable(log of people to events), signups(additional info-optional). I have got it to where I can pull up the selected event info, but I can not seem to get the user info. I was able to get it to display the user after the login on the event selection page but when I get to the event details dialog, I loose the user info. It is at the event details part that the signup would take place or not.
    So some things I have tried were to put the userid into a session variable. session.userid = a5ws_getcurrentuser() When I try to read the variable on the dialog window, it either comes up blank or undefined. I know this is kinda vague to describe. If I can have someone help me with trying to keep the logged is user info follow all the pages/dialogs that may be opened. From what I have searched, this should work. I also tried to set it as a e._state variable with no luck.

    So here is how the DB works:

    user logs in and is presented with a list of events
    user selects event and gets details about the event
    If user decides it is something they want to participate in, they click a sign up button
    button performs table update and/or prompts for additional info (signup) - linktable creates a new record with event id, userid, signupid(optional)
    if user not interested can return to event list
    user returned to event list

    So I need to be able to retrieve the current user per session to log the signup properly but like I said, I seem to be doing something wrong where it seems I loose the info.
    The desktop version works correctly, and has no issues. I am still learning javascript and xbasic and how to design this web interface. I managed to do some on my own with researching topics on the message board here. I am just completely stumped on this one issue. I can post the whole DB if that helps.

    #2
    Re: Help with passing user info among pages/dialogs

    Think about it like this...can you build a ux to display the user information? If so what field defines the user? This the key to display related info. Perhaps you may want to think about how the database tables store the way info in the first place. Cheers.:-)
    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


      #3
      Re: Help with passing user info among pages/dialogs

      This is how I do it: Each user has a unique ID (Primary Index), and that is what I use for my session.user. All you have to on the other objects is grab session.user and away you go.
      Rapid Development, Training, Support
      http://data2web.network
      903-740-2549

      Comment


        #4
        Re: Help with passing user info among pages/dialogs

        When you store ANY information that a user enters such as selecting an event from an events table you must also have a joining table to relate the user to the event. so in short and simple terms you would need a user table, an event table, and an additional table to hold the user+the selected event.
        If you have all three, and you want to see the event the user signed up for you would use the 3rd table. If you wanted to display information about the events, who signed up, etc. again, 3rd table.

        I hope I have not insulted you with the simplicity of it all - you probably know this much. I only wrote it out like this because you seem to be having trouble with accessing the data in what I am calling the third table.
        Sometimes, you need to step back and ask yourself, now would you find the information in the DB - then look at your form and see if it is asking the same questions.

        Good luck, hope I helped and didn't offend!

        Parker
        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


          #5
          Re: Help with passing user info among pages/dialogs

          I think you all are missing my point of trouble. I have all that working on the desktop version. My problem is i am designing a web interface for people to sign up for the event. They log in with the built in security (Web only) then are presented with a list of current events. They select an event and if they wish to sign up for it, the appropriate data is written as a new record to the link table. The data would be the user id, event id and possibly a signup id with that corresponding data for that record created in the signup table. I have most of the web interface working correctly, but it seems i am loosing who the logged on user is when i get to the event details dialog, this is where a button would create the new record in the link table with the desired information. Now I think I can get the info written to the table but when i try to see the current user in the dialog window via any form of message or textbox with the associated variable, nothing comes up or the message window says "undefined". I need to know how to get that info into the dialog-variable so it can be written to the link table with the other info.
          I hope this makes more sense.
          I am not offended by what you said Parker, but everything you described is in my desktop version and is working correctly as I stated. I am just trying to build a web interface for what I already have working.
          FYI, I am keeping the desktop version for administrative purposes and ease of use for local access (non-web). The web application has more security built in for the remote access, requires a user to have a password, local access just requires user id.
          Also, they both access the same tables/info, including the security tables for web access.

          Greg

          Comment


            #6
            Re: Help with passing user info among pages/dialogs

            Just for kicks can you add a field to your existing dialog (ux?) To show get_currentuser?
            If they are logged in this should work fine to show that you actually have persistence.
            I would check the data bindings as well for the form.
            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: Help with passing user info among pages/dialogs

              Your setup of the form may be backwards. IN other words you said they are presented with a list of events. It seems you should present them with a form that has a field to select an event from a lookup. The form should be data-bound to the 3rd table in my scenario, with a look up to the events table.

              If your data-binding is to the events table then your not really doing what your intent is. Hope that makes sense.
              Keeping with my original scenario, you want to create a form to fill in the 3rd table. NOW if your logged in you should have the user_id
              get_currentuser
              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


                #8
                Re: Help with passing user info among pages/dialogs

                There are a couple of other things to check, is security enabled on the server? Are you hosting this locally or on an actual hosted website to test?
                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


                  #9
                  Re: Help with passing user info among pages/dialogs

                  Security is enabled, currently hosted locally for testing and design, have full application server. Dialog is bound to events, but I am trying to get the current user from the security component which from what I understand keep track of each user-session. I can display the user up until the event detail dialog opens, each page before that dialog opens can display the variable containing the user. I have tried to get the user into a field called userid by the syntax on the login page, "userid = a5ws_getcurrentuser()" also tried adding "session.userid =...." but when the dialog opens I can no longer display the current user in any way.

                  Greg

                  Comment


                    #10
                    Re: Help with passing user info among pages/dialogs

                    the way to pass signed in user name to following components is via session variable or window variable. session variable, I think is better
                    and can easily moved from one to another component.
                    the way to do is, once the user logged in you will be redirecting them to somewhere right? there you assign the session variable as
                    session.user_name = a5ws_getCurrentUser()
                    then wherever you want to show them
                    you set the default value as follows
                    "=session.user_name" without the quote marks of course.
                    this will be a character field and will go into a character field.
                    let me know if this helps or you need something else.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment


                      #11
                      Re: Help with passing user info among pages/dialogs

                      I'm not sure what you mean by set the default value or the =session.user_name. Can you give me a code example?

                      Comment


                        #12
                        Re: Help with passing user info among pages/dialogs

                        http://screencast.com/t/o4ZHUgKWyk4c

                        take a look at this screencast, see how it is done.
                        same goes true for grid too.
                        thanks for reading

                        gandhi

                        version 11 3381 - 4096
                        mysql backend
                        http://www.alphawebprogramming.blogspot.com
                        [email protected]
                        Skype:[email protected]
                        1 914 924 5171

                        Comment


                          #13
                          Re: Help with passing user info among pages/dialogs

                          Ok I understand the default value now, and it is tracking the user. So now that I know it is tracking properly, I can go onto my next set of programing. Thanks for the help.

                          Comment

                          Working...
                          X