[RPG] How to show a image in a html file

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
Taku Izumi
Posts: 12
Joined: Wed Jul 10, 2013 12:23 pm

[RPG] How to show a image in a html file

Post by Taku Izumi » Thu Aug 08, 2019 11:32 am

Hi,

I am trying to show a image in a html file.
So, I created the following codes, however a image set to the resource property of Webview is not shown.
Sample.html and emploee_128.png are in resource folder.
I use iPhone for testing of this.
Does anyone know a solution?

DDS

Code: Select all

4  1'&&F'
4 10'<<WEBVIEW>>'       
4 10HTML('Type: WebView 
    Border.Thickness: 1 
    AllowZoom : Y       
    Border.Color: Blue')
RPG

Code: Select all

LRNG_SetProperty('/Form.Fields.WEBVIEW.RESOURCE':'employee_128.png');
LRNG_SetProperty('/Form.Fields.WEBVIEW.URL': 'Sample.html');
Sample.html

Code: Select all

<body>
	<img src="employee_128.png">
</body>
Regards,
Taku Izumi

jasonzhou
Posts: 119
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG] How to show a image in a html file

Post by jasonzhou » Fri Aug 09, 2019 9:19 am

Can you please try out the following code:

Code: Select all

<body>
	<img src="/app/resources/employee_128.png">
</body>

Taku Izumi
Posts: 12
Joined: Wed Jul 10, 2013 12:23 pm

Re: [RPG] How to show a image in a html file

Post by Taku Izumi » Tue Aug 20, 2019 1:07 pm

Hi,

I changed the html code but still not show a image.

Next, I changed the html to the original source code and executed with the Windows, the image was shown.

Result_of_WinApp.png
Result_of_WinApp.png (13.23 KiB) Viewed 79 times

This code is Windows OK, iPhone NG.

Code: Select all

<body>
	<img src="employee_128.png">
</body>
This code is NG with both Windows and iPhone.

Code: Select all

<body>
	<img src="/app/resources/employee_128.png">
</body>
Best regards,
Taku

jasonzhou
Posts: 119
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG] How to show a image in a html file

Post by jasonzhou » Mon Aug 26, 2019 10:39 am

Hi Taku,

I put your code in my demo program, it works ok on iPhone.

Attached is my demo, it's almost exactly same as your code. Can you please run it seeing if it works ok?

Thanks
Jason
Attachments
sample.zip
(2.06 KiB) Downloaded 4 times

Taku Izumi
Posts: 12
Joined: Wed Jul 10, 2013 12:23 pm

Re: [RPG] How to show a image in a html file

Post by Taku Izumi » Tue Sep 10, 2019 12:22 pm

Hi Jason,

Thank you for your sample.
Your sample works OK in my iPhone.

So, I will check a difference between your sample and my one.

Best regards,
Taku

Post Reply