Questions about WebView
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Questions about WebView
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 ?
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 ?
Re: Questions about WebView
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
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
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Questions about WebView
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
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
Re: Questions about WebView
Good. If in the method :Eval I need to write some commands ?
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Questions about WebView
pure javascript code only
Re: Questions about WebView
In the :Eval() method, I can execute JS ?
:Eval("<script>..</script>")
:Eval("<script>..</script>")
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Questions about WebView
> In the :Eval() method, I can execute JS ?
Yes!
> :Eval("<script>..</script>")
No need for "<script>" and "</script>". Just use there the javascript code
Yes!
> :Eval("<script>..</script>")
No need for "<script>" and "</script>". Just use there the javascript code
Re: Questions about WebView
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 ?
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Questions about WebView
Dear Yuri,
Yes, place it on a non modal dialog box or a child window
Yes, place it on a non modal dialog box or a child window
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Questions about WebView
Dear Yuri,
Yes, place it on a non modal dialog box or a child window
Yes, place it on a non modal dialog box or a child window
Re: Questions about WebView
Thank you, Antonio!
Re: Questions about WebView
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) ?
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) ?