Hi,
sorry, I couldn’t come with a different title. Please stay with me.
I have a Web app where on a page there is a list to the left and a WebHTMLViewer to the right.
The list
I can’t use a WebList because I need to mix texts an images on a ‘line’. So I use a custom list. That list is a WebContainer and each 'line’in the list is another WebContainer displaying data to the user. A query to a database returns a certain number of records, and for each record I got I add a ‘line’ (WebContainer) in the list, one below each other.
The WebHTMLViewer
This will display a PDF file when the user click on one of the ‘lines’ (WebContainer) in the left list. I need then to display the proper PDf file.
In order to achieve my goal, I added code to the MouseUp event on a ‘line’, and added a method and properties to the WebPage. The logic works this way:
MouseUp event
Gets a a property for the ‘line’ clicked, and call a method on the WebPage (LoadPDF) with a parameter, the property of the ‘line’
LoadPDf method
- Using the argument, a query is done in a database that returns the PDF file
- The PDF file is set on a WebFile, a property of the WebPage
- and the WebHTMLViewer URL is set to the WebFileURL
Question: is there something wrong with the way I coded this ?
I asked because I have one issue. Everything else works in the LoadPDF method, getting the PDF file etc, but the PDF does not display in the WebHTMViewer. Since it’s hard to debug, I added one more line of code to the method, which is ShowURL() set to display the same PDF file from the same WebFile in a new tab. And in the new tab, I get the PDF.
I get no error setting the URL in the WebHTMLViewer, it simply does not display the PDF as if it’s URL was not set, and the debugger shows that it’s set.
What is wrong exactly ? As a test, a button was added to the WebPage, calling the LoadPDF method with a hard coded parameter, and then the WebHTMLViewer correctly displays the PDF file.
Is there an error in my code ? If not then what’s wrong ?
Thanks a million