12 Replies Latest reply: Feb 22, 2013 10:42 AM by Kim2012 RSS

    How to get the "delete" check box back?

    Kim2012
      Hi Guys,

      I just used the "Migrate to Interactive Report" feature. After doing so, the check box is gone that is used to indicate rows to delete. A copy of the region is marked as "disabled" and the check box is still there, but it's not in the newly created region. Without that check box, my page has no way to delete rows. How do I add the check box to the new Interactive Report region? I'd rather not re-create the page from scratch.

      Thanks,
      Kim

      P.S. I'm using Apex 4.1 and Oracle 11g xe - all running on Windows 7.
        • 1. Re: How to get the "delete" check box back?
          scott.wesley
          When you use that "migrate" option, APEX takes a copy of your existing region and recreates it as an interactive report instead - and disables the original classic report (condition = never).

          Whatever method you used to display a checkbox in your classic report needs to be replicated in your IR - I guess the conversion wasn't quite intelligent enough to port that across.

          Scott
          • 2. Re: How to get the "delete" check box back?
            Kim2012
            Unfortunately, the check box appeared when the page was automagically created for me via a wizard. I can drag-and-drop the buttons from the disabled region to the newly created region, but the check box won't let me grab it. The check box's "column name" is "[row selector]". I suppose the question now becomes, "How do I create a [row selector] column in the newly migrated Interactive Report?"

            I also just noticed that the items that were user-accessible in the original region are now display-only in the new Interactive region. Not good. When comparing the underlying definitions of one of the items from both regions, they look quite different. The original item allowed specifications for Reference Table and Column names. The new Interactive item doesn't. Any ideas?
            • 3. Re: How to get the "delete" check box back?
              scott.wesley
              Now I would start to question your reasoning behind converting it to an IR.

              Classic reports handle themselves as tabular forms, but interactive reports are really best for just that - querying data interactively.
              • 4. Re: How to get the "delete" check box back?
                jrimblas
                How about something like this? Instead of a check box add a new column with a delete image, you can use something like delete.gif (#IMAGE_PREFIX#delete.gif). The downside is that will be deleting one at a time, but in my experience this may not be an issue.
                Add a hidden item to hold the ID of the row your want to delete. We'll call it P1_ID.

                The new column with the delete image will need to "branch" to a URL and use this code (ALL in one single line)
                apex.confirm("Are you sure you want to delete?", {
                  request:"DELETE_ROW",
                  set:{"P1_ID":#ID#}
                  });
                Then add a page process that fires when the request is DELETE_ROW
                Would probably look something like this:
                delete from some_table where id = :P1_ID;

                A similar technique can be used for checkboxes, but it's a little more advanced as you need to loop through the selections.

                Oh and add the column to the IR you don't really need to select anything. Or better yet, you could re-use the ID column of the report if you have one as your delete column. The #ID# on the code above needs to be the name of your column. So if your column is EMPNO the above would be #EMPNO# instead of #ID#.

                Hope this helps.
                -Jorge
                • 5. Re: How to get the "delete" check box back?
                  Tom Petrus
                  I agree with Scott. If you need a tabular form, why not stick to that. Sure, you can customize an interactive report, but do you really need to?
                  Take the delete link example above. That's just a delete link even. Want input elements? Sure, that's not impossible. But then you want a CSV, and the HTML is emitted. Or you want checkboxes, same issue. The filter won't work, so disable it. And disable hiding the column (and all the other options).
                  Want tabular functionality and submit a slew of rows? Well, nothing is impossible but you're gonna have to code everything, as to where this has all been done when you use a tabular form.
                  At best, I'd consider using the modal page popup plugin to allow editing records, which has minimal impact on the IR. An ajax delete could work too, but I wouldn't take it further than that. These options work well since they can just operate from a column link and don't need you to alter the source sql to include HTML.
                  • 6. Re: How to get the "delete" check box back?
                    Kim2012
                    Okay, so let's address "why" I converted to an Interactive Report. In the standard version that was provided by the wizard, there is a maximum number of rows that are displayed at one time (I think it was 10 or 12). If the user adds one more row, they have to press Prev and Next buttons to see all of the rows in the region. In this application, the number of rows will routinely be approximately 15-20. The arbitrary maximum makes life inconvenient for the user. Thus, I was migrating to the Interactive Report not for the interactive functionality but so that I could specify to show all rows. Perhaps there is a simpler and more straight-forward approach to achieving this objective that someone can share with me. Thanks.
                    • 7. Re: How to get the "delete" check box back?
                      jrimblas
                      Oh my, you bet, on your Report Attributes under the Layout Pagination section there's a "Number of Rows" field that controls this.
                      You may not see the report change right away because the preference is cached for your session. But log out and back in and you'll see the report adjust.

                      Also... you'll notice the Number of Rows (Item) field, this one allows you to specify an Item that holds the number of rows to display. You can use a Select list with values like 50, 100, 200, All where all is a large enough number to fit most of the rows that a user wants to see.

                      Easy

                      Thanks
                      -Jorge
                      • 8. Re: How to get the "delete" check box back?
                        fac586
                        Kim2012 wrote:
                        Okay, so let's address "why" I converted to an Interactive Report. In the standard version that was provided by the wizard, there is a maximum number of rows that are displayed at one time (I think it was 10 or 12). If the user adds one more row, they have to press Prev and Next buttons to see all of the rows in the region. In this application, the number of rows will routinely be approximately 15-20. The arbitrary maximum makes life inconvenient for the user. Thus, I was migrating to the Interactive Report not for the interactive functionality but so that I could specify to show all rows. Perhaps there is a simpler and more straight-forward approach to achieving this objective that someone can share with me. Thanks.
                        Canonical example of the XY Problems that make up the bulk of questions on this forum...
                        • 9. Re: How to get the "delete" check box back?
                          jrimblas
                          fac586 wrote:
                          Canonical example of the XY Problems that make up the bulk of questions on this forum...
                          Ha! I love it!
                          • 10. Re: How to get the "delete" check box back?
                            Kim2012
                            Jorge,

                            Perfect answer! Hey, send me your address and I'll send you a 6-pack of beer.

                            Thanks,
                            Kim
                            • 11. Re: How to get the "delete" check box back?
                              jrimblas
                              Ha! Awesome, thanks!
                              I'll settle for a correct answer status on the thread. :-)
                              (And buy me a drink at a conference sometime...)
                              -Jorge
                              • 12. Re: How to get the "delete" check box back?
                                Kim2012
                                Touche.