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 do I "Go Back To Previous Page" after a Submit?

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

    How do I "Go Back To Previous Page" after a Submit?

    I want to be really clear here with my question because often I've seen answers on this forum that are "close to" the question asked but not really on target.

    My question is presented in it's simplest form and readers should not read into it more than what is said.

    I'm working with web grids at the moment and want to "Go Back To Previous Page" after a Submit?" It should work just like the Browser "BACK" button, no better, no worse. Doesn't need to be "smart" etc. JUST GO BACK!

    Is there a simple procedure in A5V8 that simply does this? Please, no responses that talk about saving previous page identity etc. It can't be that complex. If this is a web product then it Has To have a Go BACK FUNCTION.

    Thanks!

    #2
    Re: How do I "Go Back To Previous Page" after a Submit?

    If your grid has a Submit button, you also have an Update Settings section on your grid. See the Target Page property, which defaults to <self>. Change that to the page you want them to go back to and, when they cliick Submit it will process the records and go to that page.

    If you need it to be dynamic, and you never know the name of the page you want them to go back to, then that won't work because it demands a specific page name.

    Also, just to explain in advance why (if the above won't work for you) the next post could be more complex and not satisfy your rigid requirements for a simple answer, as soon as they press Submit, the previous page becomes the grid itself.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

      As I tried to explain:

      I want a "Go Back To Previous Page" after a Submit? A function that acts JUST LIKE the Back Button in a browser.

      I knew my question would invite "too much thinking" and that was what I was trying to avoid. Both for my sake and for yours.

      Let me explain:

      As Steve mentions "Update Settings section on your grid" can take you back to the page you select. Unfortunately that is Not what a BACK button does in a browser. For example if I am sitting in a grid on a page called Browse-all.a5w and I'm on record 22 and the grid only displays five records at a time, then I am several "clicks" deep into that grid component.

      If that record # 22 has a link that takes me to page
      Edit-Detail.a5w and I make a change and submit it, and I follow your method, I would be returned to the proper page but I will be sitting on record number 1. I will NOT have record # 22's page re-displayed. The Back button will do exactly that, but the Update Settings option will not.

      I know how to write javascript to do what I want, but I can't figure out how to place javascript code into a Submit button validation.

      <script language="JavaScript">
      <!-- javascript:window.history.back(1); //-->
      </script>



      More importantly, I'm trying to also evaluate "just how" complete and robust A5 really. I assumed there would be a function (that I can't find) that does what I wanted that is NATIVE to this platform.

      Comment


        #4
        Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

        Your first post described a completely different scenario than the second! It's really important to describe the scenerio accurately. Most of us that try to answer questions drop in to Alpha to actually test out the solution. That's the only responsible way to respond if the issue is not completely obvious; and I did test it in this situation.

        It will work if you put this in your initialize event:

        if eval_valid("request.referer")
        session.page = request.referer
        else
        session.page = "anerrorpage.a5w"
        end if


        and this in your aftervalidate:

        CurrentForm.RedirectTarget= session.page

        You only need the else..errorpage.a5w part if you want, probably not necessary under normal circumstances.

        And, although this code may appear to "save the previous pages' identity", it's not doing that. It is saving the URL of the page that made the call to your Edit-Detail page, or the page previous to the previous page under normal circumstances (when you press submit, the previous page becomes your Edit-Detail page.)
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

          Originally posted by Steve Wood View Post
          It will work if you put this in your initialize event:

          if eval_valid("request.referer")
          session.page = request.referer
          else
          session.page = "anerrorpage.a5w"
          end if


          and this in your aftervalidate:

          CurrentForm.RedirectTarget= session.page
          Steve,

          Where do I create/use the initialize event. I can not find a place that refers to this event. Remember I am using a web grid which I then place on a A5 web page.

          Simarily I can not figure out where to place/find/use an aftervalidate event. Are we talking about a web
          component?

          I see a list of six or so OTHER events when I examine the outline view (the tree) of my component but none of them have names to which you refer.

          Comment


            #6
            Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

            Maybe we should back up, I assumed Edit-Detail was a Dialog component based on a few words in your description and because I would use a dialog in this case. That's one of the problems with not being-there.

            If the solution below does not work please describe the link, show all of the settings that you use to create the link. Show everything that is under the Link Properties for that field, and the Calculated Expression, if there is one.

            If your Link Address Type is a DetailView Link, ignore the solution below and write back.

            Solution:

            Add the following (in green) to the Edit-Detail.A5W page in Source just after the first <%a5 tag.

            <html>
            <head>
            <%a5
            Delete tmpl_Edit-Detail
            DIM tmpl_Edit-Detail as P
            dim session.ref as c
            if eval_valid("request.referer")
            if session.ref=""
            session.ref = request.referer
            end if
            end if

            ...


            Add the following to the AfterUpdateRecords in your Edit-Detail grid

            function AfterUpdateRecords as v (Args as P, PageVariables as P)
            with PageVariables
            response.redirect(session.ref)
            session.ref = ""

            end with
            end function

            Test this out, it works but I am not quite as confident as if the Edit-Detail was a Dialog. Dialogs have more control.
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

              Did that work?
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

                Originally posted by Steve Wood View Post
                Did that work?
                Sorry for the delay, but I was called away on a critical personal matter.

                As far as your solution, No I do not believe it worked. I would need to have time to re-verify that but my "gut" remembers a sinking feeling after inputting the code and doing a test. I got very frustrated and had to get away from it for a while.

                Your solution however pointed out something to me that I thought was very insightful. It was MY BELIEF that a Dialog component would be used for simple data entry of one or two fields etc. Never thought of it as a container for a page that needed 30 - 40 fields on it. I thought that was what a Grid component was for. Especially if that data was coming right out of a table etc.

                I really don't see the connection between a Dialog component and a table.
                I'm apparently all "container fouled up". Doesn't a grid component go onto its own web page that A5 seems to create for it.

                If there is a connection between a dialog component and a table then it seems like there will be an awful lot of work to do to "GET" and "PUT" the data back and forth inside the table. That was the beauty of the GRID, I thought.

                You are right, the Dialog component seems to have more control but I can't fanthom why the Grid based web page can't have the same capabilities.

                Comment


                  #9
                  Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

                  Believe me, I know how frustrating this can be!

                  Give it a rest, then retry. I am sure it will work IF I understand what you are trying to do - which is almost always the biggest problem up on this forum.
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

                    Originally posted by Steve Wood View Post
                    Solution:

                    Add the following (in green) to the Edit-Detail.A5W page in Source just after the first <%a5 tag.

                    <html>
                    <head>
                    <%a5
                    Delete tmpl_Edit-Detail
                    DIM tmpl_Edit-Detail as P
                    dim session.ref as c
                    if eval_valid("request.referer")
                    if session.ref=""
                    session.ref = request.referer
                    end if
                    end if

                    ...


                    Add the following to the AfterUpdateRecords in your Edit-Detail grid

                    function AfterUpdateRecords as v (Args as P, PageVariables as P)
                    with PageVariables
                    response.redirect(session.ref)
                    session.ref = ""

                    end with
                    end function

                    Test this out, it works but I am not quite as confident as if the Edit-Detail was a Dialog. Dialogs have more control.
                    I finally got back to this issue and found Steve's suggestion to be successful with one caveat.

                    I had to eliminate the following two lines or I would receive and error msg.

                    Delete tmpl_Edit-Detail
                    DIM tmpl_Edit-Detail as P

                    Something about not liking the '-'. Never figured that out but don't care now.

                    Comment


                      #11
                      Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

                      It probably would be better to rename your component to : "EditDetail", leaving out the dash, and put those lines back in. And rename any other occurance of "Edit-Detail" to "EditDetail".
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: How do I &quot;Go Back To Previous Page&quot; after a Submit?

                        Hey Dude!

                        The least you could do is say thank you! Steve solved a problem for you - despite your rather impatient tone. It always kills me when people demand that their question be answered "this way" and not "that way". They want the answer - but only within the terms of their (typically) erroneous preconceptions. Guys like Steve have a lot of knowlege and experience and they go out of their way to help others. They're not paid to do so. A modicum of gratitude might be in order. Geeze!
                        Peter
                        AlphaBase Solutions, LLC

                        [email protected]
                        https://www.alphabasesolutions.com


                        Comment

                        Working...
                        X