Questions about WebView

User avatar
Antonio Linares
Site Admin
Posts: 42268
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Questions about WebView

Post by Antonio Linares »

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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Post by Natter »

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

Re: Questions about WebView

Post by Antonio Linares »

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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Post by Natter »

Good. If in the method :Eval I need to write some commands ?
User avatar
Antonio Linares
Site Admin
Posts: 42268
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Questions about WebView

Post by Antonio Linares »

pure javascript code only
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Post by Natter »

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

:Eval("<script>..</script>")
User avatar
Antonio Linares
Site Admin
Posts: 42268
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Questions about WebView

Post by Antonio Linares »

> 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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Post by Natter »

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

Re: Questions about WebView

Post by Antonio Linares »

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: 42268
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Questions about WebView

Post by Antonio Linares »

Dear Yuri,

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

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Questions about WebView

Post by Natter »

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

Re: Questions about WebView

Post by Natter »

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) ?
Post Reply