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

If, then redirect page in dialog

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

    If, then redirect page in dialog

    I'm trying to achieve a simple page redirect in my NewUser dialog.

    This is what I have in my Aftervalidate event.
    ------------------
    a5ws_get_user_values(CurrentForm,request)
    request.variables.ulink=userid

    If CurrentForm.Controls.groups.CheckBox.choices = "Employers"
    CurrentForm.RedirectTarget = "Employer_Register.a5w"
    Else
    CurrentForm.RedirectTarget = "JS.a5w"
    End if
    ------------------
    The group checkbox choices are Employers or Job Seekers

    Goal is a new user chooses Employers, user is directed to Employer_Register.a5w. If user chooses Job Seekers, user is directed to the JS.a5w page. Currently the If statement is commented out in my project.

    The request.variables.ulink=userid works fine.

    If this is already posted elsewhere, I apologize. I searched but could not find it and have been working on this issue for 4 hours.
    Eric

    Alpha Five Websites
    longlivepuppies.com
    socialservicenetwork.com
    -------------------------------------------------
    socialservicenetwork.org

    #2
    Re: If, then redirect page in dialog

    Change your control to a RadioButton. The checkbox will allow BOTH or NONE to be selected, a Radio only allow one.

    Then, this syntax will work:

    if currentform.controls.yourRadioButton0 = "employers"
    currentform.redirecttarget = "emppage"
    else
    currentform.redirecttarget = "jobpage"
    end if
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: If, then redirect page in dialog

      Thank you again Steve for your help.
      Eric

      Alpha Five Websites
      longlivepuppies.com
      socialservicenetwork.com
      -------------------------------------------------
      socialservicenetwork.org

      Comment


        #4
        Re: If, then redirect page in dialog

        I tried the above code. I tried it with many variations. No matter what choice I make, Employers or Job Seekers, after submit, it redirects to the index page.

        Also my request.variables.ulink=userid no longer works. It will work if I comment out the "If" code just given.

        Below is what I currently have in my aftervalidate for a dialog.

        a5ws_get_user_values(CurrentForm,request)
        request.variables.ulink=userid

        If currentform.controls.groups = "Employers" then
        currentform.redirecttarget = "Employer_Register.a5w"
        Else
        currentform.redirecttarget = "index.a5w"
        end if

        I did change groups to RadioButton.
        control name: groups
        data source type: variable
        variable name: GroupList

        Any additional suggestions, ideas?

        Thanks again,
        Eric
        Eric

        Alpha Five Websites
        longlivepuppies.com
        socialservicenetwork.com
        -------------------------------------------------
        socialservicenetwork.org

        Comment


          #5
          Re: If, then redirect page in dialog

          I did not catch that your "groups" control was actually the security framework group list until this last post. To update the security, the groups control must be a checkbox control, not the radio button I suggested. But you still can't allow the user the option of selecting one or both, because selecting both would completely mess up what you are trying to do in the redirect. Plus it would add them to both security groups, which I don't think you want (can a person be in both groups?). Finally, someday you are going to want an Administrators security group, then your AddUser dialog would automatically offer that checkbox option to them, which you definitely don't want.

          I'd save yourself the headache and just create two different sets of NewUser dialogs, one for each. The only difference is where you have your grouplist variable, there instead of grabbing the live security framework group list, you would just say:

          grouplist ="Employer" or grouplist="jobSeeker" as necessary.

          Answering your original question, if Employer_Register.a5w is restricted to only users belonging to the Employer security group, the reason they are getting kicked back to the Index page when you try to redirec them is because they are not logged in. Just adding someone to the security framework does not authorize them to do anything, they have to log in.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: If, then redirect page in dialog

            Hello Steve,
            1) I already have Administrator as part of the security group. I filter it out so it isn't visible to "NewUsers" by using this is my Activate

            queslist = a5ws_get_security_ques(request)
            pagelist = a5ws_get_page_list(request)

            'create grouplist filter
            grouplist = a5ws_get_groups(request,.t.)
            'remove 'Administrator' from groups list
            grouplist = filter_string(grouplist,"Administrators",crlf(),.T.)

            Employer_Register.a5w is NOT a restricted page. It is actually available to ALL users. I just wanted to be able to redirect new users to the appropriate page depending on what "group" they chose to be in.

            Currently the group RadioButton method you suggested, DOES correctly populate the group with my choices. I can see this under "Users and Groups"

            What if I added another control called User_Type? Make it radio or dropdown. Here they could make the choice, again, if they are an Employer or Job Seeker. Then depending on the choice, the newuser who registers would be directed to the appropriate page.
            Eric

            Alpha Five Websites
            longlivepuppies.com
            socialservicenetwork.com
            -------------------------------------------------
            socialservicenetwork.org

            Comment


              #7
              Re: If, then redirect page in dialog

              Thanks for the correction on RadioButton for groups, didn't know that.

              You should not need a second control. I would find out what the actual value of currentform.controls.groups is at the critical time. I often use this to test values:

              save_to_file("c:\test.txt",currentform.controls.groups)

              If that value = "Employers" then I cannot see why your redirect would not work.
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Re: If, then redirect page in dialog

                I see SAVE_TO_FILE() in the help but I don't know where to put this string. In the aftervalidate?

                Also, request.variables.ulink=userid doe NOT work when I use the redirect functions.
                Eric

                Alpha Five Websites
                longlivepuppies.com
                socialservicenetwork.com
                -------------------------------------------------
                socialservicenetwork.org

                Comment


                  #9
                  Re: If, then redirect page in dialog

                  Just on top of this, so you know the value just before its used:

                  If currentform.controls.groups = "Employers" then
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: If, then redirect page in dialog

                    I used this --> save_to_file(currentform.controls.groups, "c:\test2.txt") which gave me this as a result 5f8c48b1911041fc8bee4cb8fee6310d

                    This is ALL I have in my aftervalidate

                    a5ws_get_user_values(CurrentForm,request)
                    request.variables.ulink=userid

                    save_to_file(currentform.controls.groups, "c:\test2.txt")

                    If currentform.controls.groups = "Employers"
                    currentform.redirecttarget = "Employer_Register.a5w"
                    Else
                    currentform.redirecttarget = "Jobs_List.a5w"
                    end if

                    For some reason one works (redirect OR request.variables) when I comment out the other. They do NOT work at the same time.
                    Last edited by EricN; 01-08-2008, 06:06 PM.
                    Eric

                    Alpha Five Websites
                    longlivepuppies.com
                    socialservicenetwork.com
                    -------------------------------------------------
                    socialservicenetwork.org

                    Comment


                      #11
                      Re: If, then redirect page in dialog

                      Well...this works.

                      a5ws_get_user_values(CurrentForm,request)
                      If Request.Variables.Ulink=userid
                      currentform.redirecttarget = "Employer_Register.a5w"
                      Else
                      Request.Variables.Ulink=userid
                      End If

                      A dedicated NewUser dialog just for Employers and one just for Job Seekers.

                      Now I'm attempting to filter the groups choices that will be displayed on the web page form. I'm currently using grouplist = filter_string(grouplist,"Administrators",crlf(),.T.) to filter out Administrators but can't see how to filter out Job Seekers in the same command.
                      Eric

                      Alpha Five Websites
                      longlivepuppies.com
                      socialservicenetwork.com
                      -------------------------------------------------
                      socialservicenetwork.org

                      Comment


                        #12
                        Re: If, then redirect page in dialog

                        But now its easy. Remove everything regarding grouplist and just put this above where you save to the security in the Valiadte step.

                        dim request.variables.groups as c
                        request.variables.groups = "Employers"

                        You don't need to 'pull' those values out of security in order to use them. The above ends up being the same as if you got the values from security, and then filtered out the ones you don't want.
                        Steve Wood
                        See my profile on IADN

                        Comment


                          #13
                          Re: If, then redirect page in dialog

                          Originally posted by Steve Wood View Post
                          But now its easy. Remove everything regarding grouplist
                          So� I take the group list filter out of the activate area?

                          This is what I have now have...
                          validate
                          a5ws_save_user_values(CurrentForm,request)
                          dim request.variables.groups as c
                          request.variables.groups = "Employers"

                          aftervalidate
                          a5ws_get_user_values(CurrentForm,request)

                          If Request.Variables.Ulink=userid
                          currentform.redirecttarget = "Employer_Register.a5w"
                          Else
                          Request.Variables.Ulink=userid
                          End If
                          Eric

                          Alpha Five Websites
                          longlivepuppies.com
                          socialservicenetwork.com
                          -------------------------------------------------
                          socialservicenetwork.org

                          Comment


                            #14
                            Re: If, then redirect page in dialog

                            The code I suggested goes before, not after, the save_user_values function.
                            Steve Wood
                            See my profile on IADN

                            Comment


                              #15
                              Re: If, then redirect page in dialog

                              For some reason the userid field is now automatically filled with the word "Required." When I attempt to put anything in, it says, "userid:required data missing." I think I've been at this tooooo long today.

                              I did have info in the Profile application variables area but took it out.
                              Last edited by EricN; 01-08-2008, 08:17 PM.
                              Eric

                              Alpha Five Websites
                              longlivepuppies.com
                              socialservicenetwork.com
                              -------------------------------------------------
                              socialservicenetwork.org

                              Comment

                              Working...
                              X