Hi,
I have been working with Xojo for about a month an a half, creating demos. I always solved issues but this time, I can’t figure out.
Xojo version: 2018 R1.1
OS: Windows 10 1709 full patched
Type of application: Web
When the user do a selection in a list, the corresponding PDF should be displayed in a WebHTMLViewer. This viewer is inside a WebContainer, and this WebContainer is on my WebPage.
Everything, well almost, works. I get the PDF from a FileMaker database and is stored in a WebFile which is a property of the WebPage. When I set the WebHTLMLViewer URL to that of the WebFile, nothing happens, the PDF is not displayed at all. I tried adding a new WebHTMLViewer right on the WebPage, sams issue. But If I call ShowURL in a new page, the the browser opens a new tab and display correctly the PDF.
Here is the final code:
[code]Dim conn As New FM_connection
Dim strData As String
’ On va chercher le pdf
’ Gets the PDF file from the database and loads it in a WebFile (property of WebPage1)
conn.GetPDFDemande(CStr(WebPage1.ListeDesCas.mSelectedLine.recordID))
If WebPage1.PDFWebFile <> Nil Then
WebPage1.PDFWebFile.FileName = “Fichier.pdf”
WebPage1.PDFWebFile.MIMEType = “application/pdf”
’ The WebHTMLViewer URL is set to that of the WebFile
Me.WP1HTMLViewer.URL = WebPage1.PDFWebFile.URL ’ The content of the WebHTMLVIewer is not changed
Me.WP1HTMLViewer.SetFocus ’ tried this to see if that would help
ShowURL(WebPage1.PDFWebFile.URL, True) ’ Tada, the PDF is displayed, not where I wishes though
strData = WebPage1.PDFWebFile.Data
End If[/code]
I tested inside FreFox.
Just what am I doing wrong ???
Many thanks