Hello, I just upgraded from Powerbuilder 10 to Powerbuilder 2021 and I want to use the new WebBrowser object you are providing. I cannot find any good example or tutorial about how to use it. I haven't been able to load a web page so far. I am setting up a default url and nothing happens. Can you help me please? I need a step by step guide because I am using this object for the first time. The documentation isn't very helpful.
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- How can I make WebBrowser control work? (Powerbuilder 2021)
- Dimitris Kelekis
- PowerBuilder
- Wednesday, 9 February 2022 09:49 AM UTC
- Wednesday, 9 February 2022 10:36 AM UTC
- PowerBuilder
- # 1
Have you looked at this: https://docs.appeon.com/pb2021/pbug/Working_with_WebBrowser.html ?
Here's an example application that uses the control: https://github.com/Appeon/PowerBuilder-Graph-Example
regards
- Wednesday, 9 February 2022 10:48 AM UTC
- PowerBuilder
- # 2
Check out this post: https://community.appeon.com/index.php/qna/q-a/apache-echarts-saveasimage?limitstart=0#reply-28260
You might have to set some parameters in the open event of your application object.
There's been several people having the same problem and this solved their blank page problem.
regards
- Dimitris Kelekis
- Wednesday, 9 February 2022 11:58 AM UTC
-
Helpful Loading... Helpful 0
- Wednesday, 9 February 2022 12:08 PM UTC
- PowerBuilder
- # 3
you are saying you are trying to set 'default' url?
I made a small sample app that does this (pb 2021). For me it works.
When I tried setting the value in the constructor of the webbrowser control, it failed though .. white page.
Looking at the help on "defaulturl", it turns out you can only set this value in the properties of the control. Not by setting it in code (which seems funny to me).
See the attached app. It only has a main window with a wb control and the property set to "https://www.google.co.uk".
If you get an error on WebbrowserSet() when opening the application, you probably still have "pbcefclient.exe" running in the taskmanager. Once you kill that task and restart powerbuilder (a reboot might be easier as I had many problems killing it), it should work.
regards.
- Miguel Leeuwe
- Wednesday, 9 February 2022 13:40 PM UTC
Yes, have a look at the open event of the application object. It seems to be important that that code (WebbrowserSet() ) is only called in that specific script. As far as I understood it has to be called before any initialization of any webbrowser control, which makes the apps open event the perfect place to do so.
There are many outstanding tickets for the webbrowser control. In my personal opinion I can't affort to use it in production yet, but Appeon is working on integrating the latest versions of the "CEF" webbrowser control (which is the one we are using now).
-
Helpful Loading... Helpful 0
- Dimitris Kelekis
- Wednesday, 9 February 2022 14:03 PM UTC
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Wednesday, 9 February 2022 14:11 PM UTC
Maybe a reason could be that you migrated your project? Something in the source code of the applicaton object's "additional properties" maybe pointing to the wrong runtime.
good luck!
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.
The same applies to the Graph Example. The webbrowser controls remain blank.