How to exchange data between web client and FW

How to exchange data between web client and FW

Postby Otto » Thu Jul 22, 2021 4: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: Select all  Expand view  RUN

#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: Select all  Expand view  RUN

<!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>

 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: How to exchange data between web client and FW

Postby Natter » Thu Jul 22, 2021 1: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
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: How to exchange data between web client and FW

Postby Otto » Thu Jul 22, 2021 2: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: How to exchange data between web client and FW

Postby Natter » Thu Jul 22, 2021 2: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
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: How to exchange data between web client and FW

Postby Antonio Linares » Fri Jul 23, 2021 6:02 am

Dear Otto,

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

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

Re: How to exchange data between web client and FW

Postby leandro » Fri Jul 23, 2021 8: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

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: How to exchange data between web client and FW

Postby Otto » 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: How to exchange data between web client and FW

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wilsongamboa and 87 guests