• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

URL Widget

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

  • URL Widget

    I have an app that includes the URL Widget. The widget is supposed to display pdf files stored on the IFS. The widget is displayed when a row is clicked on a grid. The URL is set based upon information in the row. However, the pdf will not display. The pdfs are not in the valence6 directory. I'm using a fully qualified path. What am I missing?

  • #2
    Can you take the URL you're setting on the URL widget and place that in a browser tab to access the PDF?

    Comment


    • #3
      No. But if I copy the pdf file to a folder in the valence6 directory, then it displays in the widget.

      Comment


      • #4
        It needs to be accessible from the browser. Assume your Apache instance needs to be updated to access that folder on the IFS, just like the Apache instance has access to the resources folder within the Valence instance

        Comment


        • #5
          How do I do that?

          Comment


          • #6
            Update your Apache config file using IBM Web Administration for i, which you access via the browser (for example, yourIBMi:2001/HTTPAdmin), and add the path where the PDFs are stored

            Example
            Code:
            Alias /myCustomerPdfs /someFolder/myCustomerPdfs
            <Directory /someFolder/myCustomerPdfs>
                Order Allow,Deny
                allow from all
            </Directory>
            Then, after you have updated it and restarted the Apache server, you should be able to access the files. For example, based on the example above: yourIBMi:7060/myCustomerPdfs/example.pdf

            Comment


            • #7
              I checked the Apache config and the aliases are already in place. I thought I had this working before. I did check again whether I can access the pdfs from the browser using the alias path and they open up just fine. My issue seems to be that Valence will not open the files. Can you confirm how the url should be constructed for the URL widget?

              Comment


              • #8
                It should be constructed the same as it would if you were opening it up in any browser tab. How are you using the URL widget? Are you using "Link URL" or do you have a linked app variable to set the URL? What does the path look like when it is set?

                Comment


                • #9
                  I'm using "Link URL". I've attached a screenshot of the config.

                  Attached Files

                  Comment


                  • #10
                    Any more thoughts on this?

                    Comment


                    • #11
                      Can you go to http://192.168.222.54:7060/Invoices/validInvoice.pdf from your browser directly?

                      If so, have you validated that INVIN65 doesn't have spaces, etc.?

                      Comment


                      • #12
                        Below is an image of accessing one of the pdfs directly in the browser:

                        Screenshot 2023-11-21 1.50.08 PM.png

                        The field INVN65 does not include any spaces or special characters. The only thing I see is as below when displaying the URL widget:

                        Screenshot 2023-11-21 1.57.11 PM.png

                        Comment


                        • #13
                          This appears to be a bug using "Link URL" with a URL Widget specified as a popup. We will look to get this fixed for the next build. In the meantime, you can use an app variable.
                          • Create new app variable "pdfPath" or whatever you choose.
                          • Use Link To App Variables against the URL widget and link the "URL" property to the newly created app variable
                          • Upon click
                            • Set App Variables
                              • pdfPath = /Invoices/{INVN65}.pdf
                            • Hide/Show Widgets
                              • Show the URL widget popup

                          Comment


                          • #14
                            That worked. Thanks.

                            Comment

                            Working...
                            X