6 Replies Latest reply on Jun 22, 2017 11:36 AM by Becky-IT

    Trouble creating Dynamic Action on a link in a Master Detail Report

    Becky-IT

      My environment is as follows:

      Oracle 10g on Linux

      RAC install

      Apex 4.2 on Windows using Internet Explorer 11

       

      The requirement:

      1. Display a Master Detail page when a link is clicked from an IR.

      2. The Detail is a SQL Query.

      3. This page has two sets of Master Detail regions and the one displayed is determined by a value being passed in from an IR.

      4. In the Master and/or Details record a column can contain a link that displays a file that was uploaded when the record was created. 

      5. This link is generated via a PL/SQL function in the report query.

      6. The file is stored in an Oracle table.

      7. When the link is clicked, the file is downloaded.

      8. The clicked link needs to call code to insert data into a Metrics table, i.e. what file was downloaded, when, by whom, etc.

       

      The problem:

      1.  The problem is the report columns don't have the classic name="f01_999" format.   The column names are used.  In this case REQUEST_ATTACHMENT.

      2.  I created a Dynamic Action for an Click event:

           Event: Click

           Selection Type: jQuery Selector

           jQuery Selector: td[headers="REQUEST_ATTACHMENT"]

           Event Scope: Dynamic

       

          The True Action is just an Alert.

       

      3. This does not work.  If I change the jQuery Selector: td[headers="REQUEST_ATTACHMENT"] to jQuery Selector: td[headers="REQUEST_ATTACHEMENT_000"] the True Action does fire, but obviously on the second record it will not as the header will be REQUEST_ATTACHEMENT_001.

       

      Any assistance is greatly appreciated!

      Becky

        • 1. Re: Trouble creating Dynamic Action on a link in a Master Detail Report
          fac586

          Becky-IT wrote:

           

          My environment is as follows:

          Oracle 10g on Linux

          RAC install

          Apex 4.2 on Windows using Internet Explorer 11

           

          The requirement:

          1. Display a Master Detail page when a link is clicked from an IR.

          2. The Detail is a SQL Query.

          3. This page has two sets of Master Detail regions and the one displayed is determined by a value being passed in from an IR.

          4. In the Master and/or Details record a column can contain a link that displays a file that was uploaded when the record was created.

          5. This link is generated via a PL/SQL function in the report query.

          6. The file is stored in an Oracle table.

          7. When the link is clicked, the file is downloaded.

          Downloaded how? If the link target was an on-demand process then this could call the metric data capture method before performing the download request, eliminating any need for an additional action...

          8. The clicked link needs to call code to insert data into a Metrics table, i.e. what file was downloaded, when, by whom, etc.

           

          The problem:

          1. The problem is the report columns don't have the classic name="f01_999" format. The column names are used. In this case REQUEST_ATTACHMENT.

          2. I created a Dynamic Action for an Click event:

          Event: Click

          Selection Type: jQuery Selector

          jQuery Selector: td[headers="REQUEST_ATTACHMENT"]

          Event Scope: Dynamic

           

          The True Action is just an Alert.

           

          3. This does not work. If I change the jQuery Selector: td[headers="REQUEST_ATTACHMENT"] to jQuery Selector: td[headers="REQUEST_ATTACHEMENT_000"] the True Action does fire, but obviously on the second record it will not as the header will be REQUEST_ATTACHEMENT_001.

          There's something wrong there. Where are the sequence numbers being generated?

           

          The headers attribute references the ID of the table header(s) that apply to a cell. This value may change on a columnar or row basis to include different cell references (e.g. for column and row headers in a matrix report: <td headers="col-id row-id" ...>) but in a given row or column axis one of the header references must necessarily be fixed, i.e. all of the cells in a row will reference the same row header(s), with changing column header(s); all of the cells in column will reference the same column header(s), but have varying row header(s).

           

          If the REQUEST_ATTACHEMENT_XXX headers are being generated as row headers, the link column should have a fixed column header: <td headers="LINK REQUEST_ATTACHEMENT_XXX" ...> that can be targeted by an attribute prefix selector: td[headers^="LINK"].

          • 2. Re: Trouble creating Dynamic Action on a link in a Master Detail Report
            Becky-IT

            The requirement:

            1. Display a Master Detail page when a link is clicked from an IR.

            2. The Detail is a SQL Query.

            3. This page has two sets of Master Detail regions and the one displayed is determined by a value being passed in from an IR.

            4. In the Master and/or Details record a column can contain a link that displays a file that was uploaded when the record was created.

            5. This link is generated via a PL/SQL function in the report query.

            6. The file is stored in an Oracle table.

            7. When the link is clicked, the file is downloaded.

            Downloaded how? If the link target was an on-demand process then this could call the metric data capture method before performing the download request, eliminating any need for an additional action...

            The link is generated via a PL/SQL function in the report query.  The function retrieves information from a separate table, i.e. DOCUMENT table and uses wpg_docload.download_file to download the file.  The link looks like:

            <tt>

            <a href="javascript:window.location.href='http://my.domain/my_dad/core_utilities.document_content.download?p_file=my_document_name.pdf&p_doc_id=27'" target=_default'">**View Attachment**</a><font color="#ff66000"><br>Enable virus scan on opening.</font>

            </tt>

            3. This does not work. If I change the jQuery Selector: td[headers="REQUEST_ATTACHMENT"] to jQuery Selector: td[headers="REQUEST_ATTACHEMENT_000"] the True Action does fire, but obviously on the second record it will not as the header will be REQUEST_ATTACHEMENT_001.

             

            There's something wrong there. Where are the sequence numbers being generated? This is the issue!

             

            The headers attribute references the ID of the table header(s) that apply to a cell. This value may change on a columnar or row basis to include different cell references (e.g. for column and row headers in a matrix report: <td headers="col-id row-id" ...>) but in a given row or column axis one of the header references must necessarily be fixed, i.e. all of the cells in a row will reference the same row header(s), with changing column header(s); all of the cells in column will reference the same column header(s), but have varying row header(s).

             

            If the REQUEST_ATTACHEMENT_XXX headers are being generated as row headers, the link column should have a fixed column header: <td headers="LINK REQUEST_ATTACHEMENT_XXX" ...> that can be targeted by an attribute prefix selector: td[headers^="LINK"].

            This is a report with a break on REPLY_DATE. 

            The header looks like:

            <tt>

            <tr>th id=REQUEST_ATTACHMENT_000" class="t13ReportHeader">Attachment</th>

            </tt>

             

            The column in the 1st row looks like:

            <tt>

            <td valign="top" headers="REQUEST_ATTACHMENT_000" class="t13dataalt" <a href="javascript:window.location.href='http://my.domain/my_dad/core_utilities.document_content.download?p_file=my_document_name.pdf&p_doc_id=27'" target=_default'">**View Attachment**</a><font color="#ff66000"><br>Enable virus scan on opening.</font><br></td>

            </tt>

             

            The column in the 2nd row looks like:

            <tt>

            <td valign="top" headers="REQUEST_ATTACHMENT_001" class="t13dataalt" <a href="javascript:window.location.href='http://my.domain/my_dad/core_utilities.document_content.download?p_file=my_document_name.pdf&p_doc_id=27'" target=_default'">**View Attachment**</a><font color="#ff66000"><br>Enable virus scan on opening.</font><br></td>

            </tt>

             

            If thought of inserting the metric data via the called function, but the link isn't actually clicked at that point.  It's just displaying the link.

            If there is a better way to do this, I am open to suggestions.

            • 3. Re: Trouble creating Dynamic Action on a link in a Master Detail Report
              fac586

              Becky-IT wrote:

               

               

              This is a report with a break on REPLY_DATE.

               

              The header looks like:

               

              <tr>th id=REQUEST_ATTACHMENT_000" class="t13ReportHeader">Attachment</th>

              A Repeat headings on break control break would explain addition sequence numbering on the header row IDs.

               

              As suggested above, an attribute prefix selector (td[headers^="REQUEST_ATTACHMENT"] a:link) could be used in DAs to target links in this column.

              If thought of inserting the metric data via the called function, but the link isn't actually clicked at that point. It's just displaying the link.

              The metric data capture method would have to be called from core_utilities.document_content.download.

              If there is a better way to do this, I am open to suggestions.

              As suggested above, create an on-demand process on the report page that performs the metric data capture then calls core_utilities.document_content.download to download the file. The report link would then reference this process rather than the download method.

               

              Also note that:

              1 person found this helpful
              • 4. Re: Trouble creating Dynamic Action on a link in a Master Detail Report
                Becky-IT

                I will give it shot and let you know what happens.

                 

                Thanks so much for your help.

                • 5. Re: Trouble creating Dynamic Action on a link in a Master Detail Report
                  Becky-IT

                  I changed the jQuery to (td[headers^="REQUEST_ATTACHMENT"] a:link) in the DA and it worked, BUT, when I tried it on a Thin Client it did not work.  It did work on a Thick Client.  Both are using Internet Explorer 11. 

                   

                  Any suggestions?

                  • 6. Re: Trouble creating Dynamic Action on a link in a Master Detail Report
                    Becky-IT

                    I removed ":link" and now it works in all environments!