1. Dimitris Kelekis
  2. PowerBuilder
  3. Wednesday, 9 February 2022 09:49 AM UTC

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.

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 9 February 2022 12:08 PM UTC
  2. PowerBuilder
  3. # 1

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.

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Wednesday, 9 February 2022 13:40 PM UTC
Glad you got this working so far!

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).
  1. Helpful
  1. Dimitris Kelekis
  2. Wednesday, 9 February 2022 14:03 PM UTC
In your project it is working! In mine after following exactly what you did, it is not! I don't get why. I will report it as a bug and I hope I get a solution to that.
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 9 February 2022 14:11 PM UTC
yes, that's a good idea.

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!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 9 February 2022 10:48 AM UTC
  2. PowerBuilder
  3. # 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

Comment
  1. Dimitris Kelekis
  2. Wednesday, 9 February 2022 11:58 AM UTC
I also tried the solution in that post. I added the configuration showed in my application object open event but still the testing web page I try to load (Google.com) does not show up. Again a blank page.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 9 February 2022 10:36 AM UTC
  2. PowerBuilder
  3. # 3

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

Comment
  1. Dimitris Kelekis
  2. Wednesday, 9 February 2022 10:44 AM UTC
Of course I looked at them. I must be missing something because in every attempt I make the navigatestart() event runs but nothing renders at the webbrowser object. I get a white screen. Also I get not error. Just nothing loads.



The same applies to the Graph Example. The webbrowser controls remain blank.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.