-
Panos Platanas
- PowerBuilder
- Friday, 19 June 2026 09:22 AM UTC
Hi,
we are going through the PB2025R2 and we came across that the WebBrowser control does now support GetSource().
The idea (we do it via OLE at the moment but we are like to go tonew HTML engine) is that we want to load a Confirmation Template HTML in a string (using NavigateToString()), allow users to do some changes on the WebBrowserControl (e.g change the person's address), get the modified HTML code (GetSource()) and email it.
I cannot get it to enter a design mode. Is it only for display-only operations?
Thank you
UPDATE: I found a post in here that gave me a solution:
wb_1.EvaluateJavascriptSync("document.designMode = 'on'", REF lsResult, REF lsError)
My new problem is that although I do make change on the browser, the GetSource() returns the initial HTML
UPDATE2: Just to sum up:
The way I ended up doing it:
Fed the control with the HTML code
wb_1.NavigateToString(ls_full_body)
In the NavigationCompleted event of the control I added this code:
string lsResult, lsErrorinteger llIF issuccess THEN ll = this.EvaluateJavascriptSync("document.designMode = 'on';", REF lsResult, REF lsError)
If ll <> 1 Then MessageBox("Error", "JS Failed: " + lsError) End IfEnd If
And in my send function (since the EvaluateJavaScriptSync returns JSON) I added:
string ls_error, ls_bodyjsonwb_1.EvaluateJavascriptSync("document.documentElement.outerHTML", REF ls_bodyjson, REF ls_error)
JsonParser lnv_JsonParserString ls_JsonLong ll_RootObject
lnv_JsonParser = Create JsonParserlnv_JsonParser.LoadString(ls_bodyjson)ll_RootObject = lnv_JsonParser.GetRootItem()
ls_body = lnv_JsonParser.GetItemString(ll_RootObject, "value")
Destroy lnv_JsonParser
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.