Bug 4996

How to display in the new web browser a form using an xml file that has a local style sheet reference. ? 24 November, 2020

Claudio Burns
29 July, 2020
Product: PowerBuilder Category: Controls & UI
Version: 2019 R2 Build:
Classification: Enhancement Publishing: Public
Priority: P3
Status: Closed Reason: FIXED
Zhao Kai @Appeon 24 November, 2020
#13
Hi Claudio,

Thanks for your quick update. I will close this ticket! If you have any further question please open a new ticket.

Regards,
ZhaoKai


-------------------------------------------------------------------
From: Servizio Assistenza 
Sent: Tuesday, November 24, 2020 4:40 PM

Hi ZhaoKai,
as I answered a previous email the R3 beta solves the issue.  You can close the ticket.
thank you 
 
Claudio
Zhao Kai @Appeon 24 November, 2020
#12
Hi Claudio,

I would like to check with you if the response provided has been helpful enough
to resolve your case. If so, can we proceed to close the ticket?
Otherwise, do let us know if we can provide you with any further assistance and
keep in mind that you are always welcome to open another ticket in case you
need it.

Regards,
ZhaoKai
Zhao Kai @Appeon 15 September, 2020
#11
Hi Claudio,

PowerBuilder 2019 R3 Beta is currently offered as a “customer beta”, which allows all existing PowerBuilder subscribers to participate. 

We find that you only have one offline license and it is not easy for you to just sign out the license from one machine and then log in to another one like an online license. We suggest you request a 30-day trial license from https://www.appeon.com/freetrial?product=pb&application=pb using a new account or switch the license to an Online license. Thanks for your understanding. 

To test the web browser enhancements, please add the script below in the open event of the application object. Please note that you need to restart PB IDE after executing the script to make it take effect.
WebBrowserSet("allow-file-access-from-files", "true" )


Regards,
ZhaoKai
Claudio Burns 15 September, 2020
#10
Hi ZhaoKai,
i downloaded and installed the beta on another pc as you suggested.  The problem is PB asks for a licence.  Shouldn't a beta be licence free and time locked?.
How can i test the web browser enhancements?
Tia 
Claudio
Zhao Kai @Appeon 14 September, 2020
#9
Hi Claudio,

We are glad to inform you that PowerBuilder 2019 R3 Beta is available for your evaluation. The bug or enhancement you reported in this ticket has been fixed or implemented in this release. Please download and install it to verify it on your side and let us know your feedback soon!

You can use the WebBrowserSet function to set the flag, currently, it supports the below two flags.
allow-file-access-from-files 
-- Whether to allow access to the local files (XML etc.). The value is "true" or "false" (by default).
enable-media-stream 
-- Whether to allow access to the microphone or camera. The value is "true" or "false" (by default).

You can find the Beta installer, release notes, and more about this release from the link below. (You need to sign in with your Appeon account)
https://account.appeon.com/download/beta

Warnings: 
1.      Do not use a Beta release for production use. 
2.      PowerBuilder 2l019 R3 cannot coexist with PowerBuilder 2019 or PowerBuilder 2019 R2. It will upgrade/overwrite these versions. We suggest that you install it on a separate machine or a virtual machine for your test. 

Regards,
ZhaoKai
Zhao Kai @Appeon 23 August, 2020
#8
Hi Claudio,

Just a quick update. I checked with our developers and it is hard for us to provide the interface so we will add this flag first in our project and you can test in PB 2019 R3 once we release it. And we will consider providing an interface for the user to configure in the future.


Regards,
ZhaoKai
Zhao Kai @Appeon 11 August, 2020
#7
Hi Claudio,

Thanks for your valuable suggestion. We'll transfer it to our product team for consideration.

Regards,
ZhaoKia
Claudio Burns 11 August, 2020
#6
Hi ZhaoKai,
I think you should allow us to set all the flags as proprieties of the web browser object both from the painter and programmatically, you never know what other flag we are going to need in the future.
Hoping you make the enhancement fast, we were hoping to not being dependent from major browsers anymore,
tia
Claudio
Zhao Kai @Appeon 10 August, 2020
#5
Hi Claudio,

Thanks for providing the information. For Chrome, running Chrome with the --allow-file-access-from-files flag could solve the issue, please refer to the article below for detail. 
https://stackoverflow.com/questions/2981524/how-can-i-make-xslt-work-in-chrome

Sorry that there is no way to use the --allow-file-access-from-files flag on the WebBrower control. We'll record it as a new requirement/enhancement request and transfer it to our product team for consideration.


Regards,
ZhaoKia
Claudio Burns 10 August, 2020
#4
Hi ZhaoKai,
i know for sure the problem is related to CORS but i don't know how to set the right flag on the web browser.
No customer of ours has a web server and therefore your suggestion is not viable.
Our app is a desktop client/server appplication and we send the xml file to the default web browser which we force our customers to set to Firefox as a default.
To display correctly the xml file in Firefox you must do the following:
click on the "+" sign to open a new page
in the address field write "about:config" , without the quotes, and confirm the warning.
find the property "privacy.file_uniq_origin" and set it to false.
close the page and try to display the xml file. If it still doesn't work you must set to false also the following property:
"security.fileuri.strict_origin_policy".

Hope you can give me a better workaround
Claudio
Zhao Kai @Appeon 09 August, 2020
#3
Hi Claudio,

This issue might relate to the browser itself.
It only works on IE on our end when I try to open the XML file via a path like "C:\example_dir\filedocumento.xml", I got the below result on firefox.
IT 01879020517 46 FPR12 KRRH6B9 05750505 info@arubapec.it IT 0719XXXXXXX BRNCLDXXXXXXXXXX CLAUDIO BURNS RF01 VIA XXXXXXXXX XXXXXX 0000 80126 NAPOLI NA IT 0000000000 IT 0717XXXXXXX RICERCHE E METODI SRL VIA G.FERRARIS 66C 80142 NAPOLI NA IT TD01 EUR 2020-08-05 7/20 812.52 Fattura normale 1 Analisi, sviluppo,ass.software, elaborazione dati,int.tecnici per vs. fabbisogno interno 6.0000 GG 111.0000 666.00 22.00 AswConCont MERVEN 22.00 666.00 146.52 I TP02 MP05 2020-08-05 812.52 BANCAXXXX SPA IT10M0200803457000000000000 02008 03457

And I got a blank page from Chrome too. WebBrowser is based on Chromium so it has the same behavior as that in Chrome.  

Anyway, you can work around the issue with the solution below.
1 Copy both XML and XSL file to the web server.
2 Using scripts like below to access the XML file on web server, it works on all browsers and WebBrowser control.
wb_1.navigate("http://192.168.168.46/xml/filedocumento.xml")


Regards,
ZhaoKai
Claudio Burns 07 August, 2020
#2
test_files.zip (145KB)

Hi ZhaoKai,
I tried what you suggested but it doesn't work. I just get a blank page. and if i examine di page content it shows just the first two lines of the xml file.  I'm attaching the xml file, the style-sheet file and a jpg showing the result i get from Firefox.  I get the same result fro IE.
Just put the xml and xsl in the same directory an then execute the following;
wb_1.navigate("C:\example_dir\filedocumento.xml").
Let me know something
TIA
Claudio Burns
Zhao Kai @Appeon 29 July, 2020
#1
Hi Claudio,

The navigate function supports loading local files, please give a try, for example:
wb_1.navigate("C:\Program Files (x86)\Appeon\ADTConfig.XML")

It seems to be a usage issue rather than a bug, we recommend posting tech how-to/advice questions to the Appeon Community: 
https://community.appeon.com/index.php/qna/ask-questions 
Questions posted to the Appeon Community may be responded to by Appeon support staff, MVPs, or other product users.

Regards,
ZhaoKai
Claudio Burns 29 July, 2020
*I need to display in the new web browser a form using an xml file that has a local style sheet reference.

Can anybody help?

*Reproduce Steps:


Remarks:
OS:
All
Platform:
32-bit
Database Type:
SAP SQL Anywhere
Database Version:
12