FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Questions about WebView
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 09:25 AM
Dear Yuri,

a) yes, you can open any web page

b) What kind of item do you need to find ? Please explain it or show an example

c) You can click it, using javascript. Why not ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 09:46 AM

oDlg:oClient:=TActiveX():New(oDlg, "Shell.Explorer.2", 0, 0, oDlg:nWidth, oDlg:nHeight)

oDlg:oClient:Do("Navigate2", "https://www.website/")

do while .T.

oDk:=oDlg:oClient:GetProp("Document")

if valtype(oDk)="U".or.oDk:ReadyState!="complete"

  WaitMessage()

  SysRefresh()

else

  lOk:=.T.

  exit

endif

enddo

if lOk

itm:=oDk:getElementById('auto_cdi')

itm:Click()

endif

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 09:57 AM

Dear Yuri,

You can execute any javascript code from your FWH app, so you can use:

oWebView:Eval( "getElementById('auto_cdi').click()" )

or

oWebView:Eval( "document.getElementById('auto_cdi').click()" )

That string is javascript code to be executed by webview

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 10:04 AM

Good. If in the method :Eval I need to write some commands ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 10:05 AM

pure javascript code only

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 10:11 AM

In the :Eval() method, I can execute JS ?

:Eval("<script>..</script>")

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Questions about WebView
Posted: Fri Nov 25, 2022 10:13 AM

> In the :Eval() method, I can execute JS ?

Yes!

> :Eval("<script>..</script>")

No need for "<script>" and "</script>". Just use there the javascript code

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Questions about WebView
Posted: Sat Dec 03, 2022 01:58 PM

WebView is loaded as a modal window and until it is closed, further operation of the program is impossible. Is it possible to open a WebView as a non-modal window ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Questions about WebView
Posted: Sat Dec 03, 2022 02:20 PM

Dear Yuri,

Yes, place it on a non modal dialog box or a child window

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Questions about WebView
Posted: Sat Dec 03, 2022 02:20 PM

Dear Yuri,

Yes, place it on a non modal dialog box or a child window

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Questions about WebView
Posted: Sat Dec 03, 2022 05:57 PM

Thank you, Antonio!

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Questions about WebView
Posted: Mon Dec 05, 2022 12:54 PM

I am creating an oWebview object:=TWebview():New and specify for it the parent POPUP dialog box oDlg - oWebview:SetParent(oDlg).

  1. Whether the webview will be resized automatically when the parent window is resized ?

  2. Is it possible to refer to the oWebview object as a control (a la oDlg:aControls[1] or oDlg:oWebview) ?

Continue the discussion