FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour open a function from a link inserted in an html (oWebview) RESOLVED
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
open a function from a link inserted in an html (oWebview) RESOLVED
Posted: Wed Mar 26, 2025 04:08 PM
I have a link on a oWbView made with Twebview2
 <div class="quick-item" onclick="callHarbourFunction('Clienti')">
                                <img src="{IMGCLIENTI}" alt="Clienti">
                                <span>Clienti</span>
                            </div>
callHarbourFunction is on a javascritpt script
<script>
                function callHarbourFunction(funcName) {
                    var data = { function: funcName };
                    var s = SendToFWH(data).then(s => {
                        alert(s.result);
                    }).catch(err => {
                        alert("Errore: " + err);
                    });
                }
            </script>

When I click on a link give me a message box with the text "array"



and not open the function clienti()

How I can resolve ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: open a function from a link inserted in an html (oWebview)
Posted: Wed Mar 26, 2025 06:03 PM

I tried with

oWebView:bOnBind := {|cJson, cCalls| ExecuteFunction(cJson, cCalls, oWebView) }

but not arrive nothing on cJson

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 253
Joined: Fri Feb 03, 2006 04:21 PM
Re: open a function from a link inserted in an html (oWebview)
Posted: Wed Mar 26, 2025 09:14 PM

Hello

How is your function that opens the WebView?

Post an example

Thanks,
Ari

FWH 2501 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: open a function from a link inserted in an html (oWebview)
Posted: Wed Mar 26, 2025 09:28 PM

Dear Silvio,

Please use XBrowse( data ) instead of MsgInfo( data )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: open a function from a link inserted in an html (oWebview)
Posted: Wed Mar 26, 2025 09:38 PM
I resolved

oWebView:bOnBind := {|hData| ExecuteFunction(hData, oWebView) }
 FUNCTION Extract(cString)
    LOCAL aData
    LOCAL cValue
    aData := (cString)
    cValue := aData[1]["function"]
    RETURN cValue
Function ExecuteFunction(hData, oWebView)
   local  cFuncName  := Extract(hData)


   DO CASE
      CASE cFuncName == "Bacheca"
         Bacheca(oWebView)
        CASE cFuncName = "Clienti"
         Clienti()
              ENDCASE
   RETURN NIL
because the string returned by bOnBind is not a valid hash but seem as an array
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion