7 Replies Latest reply on Jul 11, 2008 7:17 AM by (Max_Esquivel)

    Dynamic Form Cancel Button does not work

      I have been using DW and ADDT for a long time, and most of my apps are standard DYNAMIC LIST&gt;&gt;DYNAMIC FORM constructions. My new site works just fine in all respects except one: The CANCEL button in my dynamic forms does NOTHING. If I edit, insert or delete a record, I return to my Dynamic List after update/insert/delete. It is only the CANCEL button that does not seem to function. <br /> <br />I have several other sites developed on same machine with same installation of DW and ADDT and running on the same server (same PHP, MySQL, etc). that work correctly. The cancel button links are identical in the functioning and non-functioning sites: <br /> <br /> <form> <input type="button" name="KT_Cancel1" value="<?php echo NXT_getResource(" />" onclick="return UNI_navigateCancel(event, '../includes/nxt/back.php')" /&gt; <br /> <br />I have updated all includes and re-uploaded them to server. Same problem. I have attempted modification of the style.js file in includes/skins/ as per other posts herein (regarding problems with frames, but you never know till you try). <br /> <br />I am not using DW templates either. <br /> <br />Any ideas?? <br /> <br />Thanks all in advance!</form>
        • 1. Re: Dynamic Form Cancel Button does not work
          921creative Level 1
          This may or may not work with forms created with the Dynamic Form Wizard, but I use this code for my Cancel button in other forms I've set up and it works great:

          onclick="history.back()"
          • 2. Re: Dynamic Form Cancel Button does not work
            Level 1
            SOLVED
            Firstly, thanks adobebrian for your reply. Of course, I use that too oftentimes, but DW/ADDT should not be malfunctioning. I was about to actually implement a similar solution as to the one you suggest, but.....

            I actually found the problem last night after carefully going over the code of one of my dynamic forms. It turns out I had a duplicate line inserted by ADDT that needed to be removed. Here's the culprit:

            // Make a transaction dispatcher instance
            $tNGs = new tNG_dispatcher("../");

            How I found this and how it got duplicated:
            I noticed that my dynamic forms were also not showing the red asterisk for the required fields, so I figured it was very probably related to ADDT includes. So I grabbed a functioning dynamic form and one of the "broken" ones and compared the coding line by line, concentrating on the ADDT automatically generated code. Eventually found that I had second dispatcher instance (technically, it was there first):

            // Make a transaction dispatcher instance
            $tNGs = new tNG_dispatcher("");

            I did notice the "same directory" versus "back up one directory" argument differences, and realized that I had created the error. I usually design my GUI into a php page and then add some things like Restrict Access to Page and Logout Transaction, along with my menu, and other things. Then I use this as a blank "template" (NOT a DW template, mind you) with which to make my dynamic lists and forms, etc. The excess dispatcher instance was initially created when I added the logout transaction. I then copied this "template" into a folder, and the result was the dispatcher instance was added again with the "../" argument rather than corrected when I added the dynamic forms, so now I had tow disptacher instances, with one of them incorrectly making reference to the working directory.

            After eliminating the extra instance, everything works perfectly.

            Thanks to all and hope this helps others avoid the same mistake.
            • 3. Re: Dynamic Form Cancel Button does not work
              921creative Level 1
              Max:

              Ironically, I ran into this same issue today. The Cancel button on my Dynamic Form didn't work. I searched the code for the same duplicate you noticed and did indeed find it...

              // Make a transaction dispatcher instance
              $tNGs = new tNG_dispatcher("../");

              I deleted this extra instance, reuploaded the page, yet the Cancel button still does not work. I refreshed the page too but nada.

              Do you think there could be other code in there that is messing with the Cancel functionality?
              • 4. Re: Dynamic Form Cancel Button does not work
                Level 1
                Hi again:

                Well, in my case, I had these items duplicated, but notice they are not identical:

                // Make a transaction dispatcher instance
                $tNGs = new tNG_dispatcher("");

                // Make a transaction dispatcher instance
                $tNGs = new tNG_dispatcher("../");

                In my specific case, I had created the first instance shown above by adding a User Logout to my "template" (Not a DW template but just my own blank format to be filled in). Then I moved the page into a subfolder and did Update links, but ADDT does not update, it seems, that link. So when I added other behaviors to the same page, ADDT added the second dispatcher instance, but referenced to a directory "one level up" (i.e. "../"). In my case it was clear I needed to delete the first instance where referenced to same directory (new tNG_dispatcher(""); ) and leave on the page the second instance referenced to one directory up (new tNG_dispatcher("../"); ) simply because my includes folder is actually one directory up from where the page in question is.

                So, do you have a similar difference, and did you delete the appropriate duplicate? If they are the same, are they referencing the correct directory where your includes are? (If your problem page is two directories down from where the includes folder is, then the dispatcher should read new tNG_dispatcher("../../"); and so on.

                Hope this helps!!

                Max
                • 5. Re: Dynamic Form Cancel Button does not work
                  921creative Level 1
                  The includes directory is indeed a level up (../), so perhaps I should have deleted the other dispatcher instance. The page in question is part of my admin area, which is in an admin/ folder.

                  I'll try deleting the other instance tonight and see how that goes. Thanks!
                  • 6. Re: Dynamic Form Cancel Button does not work
                    921creative Level 1
                    Max: Thanks for pointing me in the right direction. I added the "../" to the dispatcher instance and the Cancel button works!
                    • 7. Re: Dynamic Form Cancel Button does not work
                      Level 1
                      Glad you got it sorted out. Glad to have been of help.