oWebView:bOnBind

oWebView:bOnBind

Postby Ruth » Mon Jul 01, 2024 9:08 am

Dear friends,

...PLEASE could someone be so kind as to help me with the bOnBind codeblock. Does it accept IF ... ENDIF?

The code i post here compiles perfectly, but then I add IF ... ENDIF and it errors. Maybe my syntax is wrong. Any help would be greatly appreciated.

Very kind regards to all and thanks a lot in advance,
Ruth

Code: Select all  Expand view
function webshow(console, hWnd, nlink, cHtmlContent)
    local hPost
    local cHtmlOrUrl := Curdrive() + ":\" + Curdir() + "\ini_buc.html"
    local cTest := "
Ruth"

    if Empty(oWebView)
           
        oWebView := TWebView():New(, hWnd)
        oWebView:bOnBind := { | cJson, cCalls | ;
        MsgInfo(cJson),;
        MsgInfo(cCalls),;
        hb_jsondecode(cJson, @hPost), ;
        MsgInfo("
Decoded JSON hash: " + hPost[1]),;
        oWebView:Return(cCalls, 0, "
{ 'result': '"+ cTest +"'}") ;
        }
       
        oWebView:Bind("
SendToFWH")
        oWebView:Navigate(cHtmlOrUrl)
        oWebView:SetTitle("
Edit INI File")
        oWebView:Run()
        oWebView:Destroy()        
       
    endif
    return oWebView



Code: Select all  Expand view
oWebView:bOnBind := { | cJson, cCalls | ;
        MsgInfo(cJson),;
        MsgInfo(cCalls),;
        if hb_jsondecode(cJson, @hPost), ;
        MsgInfo("Decoded JSON hash: " + hPost[1]),;
        endif,;
        oWebView:Return(cCalls, 0, "{ 'result': '"+ cTest +"'}") ;
        }
User avatar
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: oWebView:bOnBind

Postby Ruth » Mon Jul 01, 2024 11:41 am

Dear friends,

I resolved it :-)

Thank you and kind regards.
Ruth
User avatar
Ruth
 
Posts: 169
Joined: Fri Dec 07, 2007 1:26 pm

Re: oWebView:bOnBind

Postby Antonio Linares » Tue Jul 02, 2024 6:25 am

very good! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42073
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 66 guests