Questions about WebView

Re: Questions about WebView

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

Re: Questions about WebView

Postby Natter » Fri Nov 25, 2022 9: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
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

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

Re: Questions about WebView

Postby Natter » Fri Nov 25, 2022 10:04 am

Good. If in the method :Eval I need to write some commands ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Postby Antonio Linares » Fri Nov 25, 2022 10:05 am

pure javascript code only
regards, saludos

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

Re: Questions about WebView

Postby Natter » Fri Nov 25, 2022 10:11 am

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

:Eval("<script>..</script>")
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

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

Re: Questions about WebView

Postby Natter » Sat Dec 03, 2022 1: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 ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Postby Antonio Linares » Sat Dec 03, 2022 2:20 pm

Dear Yuri,

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

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

Re: Questions about WebView

Postby Antonio Linares » Sat Dec 03, 2022 2:20 pm

Dear Yuri,

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

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

Re: Questions about WebView

Postby Natter » Sat Dec 03, 2022 5:57 pm

Thank you, Antonio!
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Postby Natter » 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) ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests