FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to exchange data between web client and FW
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
How to exchange data between web client and FW
Posted: Thu Jul 22, 2021 04:20 AM
Dear Antonio,
can you please show me how I can exchange data between web part and FW?
Thank you in advance
Otto


Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oWnd, oWndChild, oActiveX, oDk 
    
   DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support" MDI
   DEFINE WINDOW oWndChild MDICHILD OF oWnd
    oActiveX = TActiveX():New( oWndChild, "Shell.Explorer" )

   oWndChild:oClient = oActiveX // To fill the entire window surface
   oWndChild:Resize()

   oActiveX:Do( "Navigate2", "c:\fwh_2021\samples\button1.html" )
   ? "wait"
    oDk := oActiveX:GetProp("Document")
   oActiveX:bOnEvent = { | event, aParams, pParams |   EventInfo( event, aParams, pParams, oActiveX, oDk )    }

   ACTIVATE WINDOW oWnd  

return nil

function EventInfo( event, aParams, pParams, oActiveX, oDk )
   local buf := ""
   local cShow := ""

   do while .T.
      if valtype(oDk:body)!="U"
         if oDk:body:ReadyState="complete"
            sysrefresh()
            buf :=  oDk:getElementById("demo"):InnerHTML  
            if len(alltrim(buf)) > 0
               cShow := buf 
               oDk:getElementById("demo"):InnerHTML := ""
               buf := ""
               ? cShow
            endif
            exit
         endif
      endif
      sysrefresh()
   enddo

return


button1.html

Code (fw): Select all Collapse
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<body>

<h2>Login Form</h2>

  
  <div class="container">
    <label for="uname"><b>Username</b></label>
    <input id="name1" type="text" placeholder="Enter Username" name="uname" required>

    <label for="psw"><b>Password</b></label>
    <input type="password" placeholder="Enter Password" name="psw" required>
        
     <button onclick="myFunction()">Click me</button>
    <label>
      <input type="checkbox" checked="checked" name="remember"> Remember me
    </label>
  </div>
 
 
<p id="demo"></p>


<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "Hello World";
}
</script>
 

</body>
</html>
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: How to exchange data between web client and FW
Posted: Thu Jul 22, 2021 01:55 PM

I did it like this:
1. Open the page in ActiveX (IE) and get the document
2. Upload an HTML file in which I specify the general variables document.DefaultView. aa=0 ;
document.DefaultView. bb="" ;
document.DefaultView. cc=123 ;
and page processing scripts.
These variables are visible in both WEB and FW

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to exchange data between web client and FW
Posted: Thu Jul 22, 2021 02:24 PM

Hello Natter,
thank you.
Can you please show some code?
Do you mean you store the file and read it again from FW?

Best regards,
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: How to exchange data between web client and FW
Posted: Thu Jul 22, 2021 02:32 PM

I didn't understand the question !
I'm not saving anything to a file. Am I just working with a common WEB page and FW

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to exchange data between web client and FW
Posted: Fri Jul 23, 2021 06:02 AM

Dear Otto,

You can do it using the new Class WebView from Cristobal :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1818
Joined: Wed Oct 26, 2005 02:49 PM
Re: How to exchange data between web client and FW
Posted: Fri Jul 23, 2021 08:48 AM

Antonio buenos días,

Cuando será publicada la nueva clase WebView creada por el Master Cristobal? :D

Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to exchange data between web client and FW
Posted: Fri Jul 23, 2021 10:04 AM

Dear Antonio,

Querying the INPUT form from FIVEWIN works. But what does not work is to navigate the form with the keyboard.
Is that a problem with web control? When I open the HTML page in Internet Explorer, the navigation works - but not with activeX.

Best regards,
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to exchange data between web client and FW
Posted: Fri Jul 23, 2021 10:45 AM

Dear Otto,

Cristobal is the right one to explain what can be done with his new class

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion