oWebView:bOnBind

Post Reply
User avatar
Ruth
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

oWebView:bOnBind

Post by Ruth »

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

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

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: 172
Joined: Fri Dec 07, 2007 1:26 pm
Contact:

Re: oWebView:bOnBind

Post by Ruth »

Dear friends,

I resolved it :-)

Thank you and kind regards.
Ruth
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: oWebView:bOnBind

Post by Antonio Linares »

very good! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply