Recent

Author Topic: [SOLVED] Load local HTML file into jWebView  (Read 1447 times)

maurobio

  • Hero Member
  • *****
  • Posts: 623
  • Ecology is everything.
    • GitHub
[SOLVED] Load local HTML file into jWebView
« on: May 26, 2023, 02:30:33 pm »
Dear ALL,

Is there any way of loading and displaying a local HTML file using a jWebView component?

Presuming this is possible, where should the HTML go? Should it be placed in the app 'assets' folder?

A simple code (even one-line) example of using jWebView for this purpose will be much helpful!

Thanks in advance!

With warmest regards,
« Last Edit: June 04, 2023, 04:01:53 pm by maurobio »
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 2.0.12 - FPC 3.2.0 on GNU/Linux Mint 19.1, Lubuntu 18.04, Windows XP SP3, Windows 7 Professional, Windows 10 Home

jmpessoa

  • Hero Member
  • *****
  • Posts: 2317
Re: Load local HTML file into jWebView
« Reply #1 on: May 27, 2023, 12:52:09 am »

jWebView methods:
Code: Pascal  [Select][+][-]
  1.     Procedure LoadFromHtmlFile(environmentDirectoryPath: string; htmlFileName: string);
  2.     procedure LoadFromHtmlString(_htmlString: string);
  3.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

maurobio

  • Hero Member
  • *****
  • Posts: 623
  • Ecology is everything.
    • GitHub
Re: Load local HTML file into jWebView
« Reply #2 on: May 27, 2023, 02:56:40 pm »
Hi, @jmpessoa!

This is what I needed!

BTW, where can I find the class definition for the jWebView component?

Thanks a lot!

Best regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 2.0.12 - FPC 3.2.0 on GNU/Linux Mint 19.1, Lubuntu 18.04, Windows XP SP3, Windows 7 Professional, Windows 10 Home

jmpessoa

  • Hero Member
  • *****
  • Posts: 2317
Re: Load local HTML file into jWebView
« Reply #3 on: May 27, 2023, 07:22:52 pm »
Quote
where can I find the class definition for the jWebView component?

put the cursor above some code ( jWebView ?) then do:  "ctl + mouse click"
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 166
Re: Load local HTML file into jWebView
« Reply #4 on: May 28, 2023, 10:27:28 am »
I did not know this, this is super useful, thank you!

Quote
where can I find the class definition for the jWebView component?

put the cursor above some code ( jWebView ?) then do:  "ctl + mouse click"
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle.

 

TinyPortal © 2005-2018