Page 1 of 1

Refresh on WebView

Posted: Fri Aug 25, 2023 6:11 pm
by Ari
Hello friends,

I'm using the WebView with DashBoard and I would like to refresh the page with F5 from the browse, but through a button, I tried to use it, and it has no effect on the button, if I click with the mouse and then press F5 ok, it works.

HB_KeyPut(VK_F5) :?

Code: Select all | Expand

* ========================================================================
METHOD TaskBI() CLASS TVSisrevBI       /* botão de refresh F5 do Browse */
* ======================================================================== 
  local oGrpDash, oButDash
    
  TASKGROUP oGrpDash PROMPT "Dashboard" WATERMARK MARCA_DAGUA BITMAP "grafico"
          
  @ 4, 10 BTNBMP oButDash PROMPT "Atualizar" SIZE 120,35 LEFT ;
          RESOURCE "chart" 2007
          
  oButDash:bAction := {|| ::oFld:aDialogs[1]:SetFocus(),;
                          HB_KeyPut(VK_F5)             ,;
                          ::oFld:aDialogs[1]:refresh() }         
                     
  ENDTASKGROUP
  
return nil
 

Re: Refresh on WebView

Posted: Sat Aug 26, 2023 12:44 am
by CharlesKwon
Ari.

It seems you are having difficulty with the page refresh in Webview.
There are various ways to refresh a page, not just using mouse macros. There's a more reliable method.

Try passing the following script to the Webview through the EVAL Method:

oWebView:EVAL( "location.reload();" )

Regards,
Chalres KWON

Ari wrote:Hello friends,

I'm using the WebView with DashBoard and I would like to refresh the page with F5 from the browse, but through a button, I tried to use it, and it has no effect on the button, if I click with the mouse and then press F5 ok, it works.

HB_KeyPut(VK_F5) :?

Code: Select all | Expand

* ========================================================================
METHOD TaskBI() CLASS TVSisrevBI       /* botão de refresh F5 do Browse */
* ======================================================================== 
  local oGrpDash, oButDash
    
  TASKGROUP oGrpDash PROMPT "Dashboard" WATERMARK MARCA_DAGUA BITMAP "grafico"
          
  @ 4, 10 BTNBMP oButDash PROMPT "Atualizar" SIZE 120,35 LEFT ;
          RESOURCE "chart" 2007
          
  oButDash:bAction := {|| ::oFld:aDialogs[1]:SetFocus(),;
                          HB_KeyPut(VK_F5)             ,;
                          ::oFld:aDialogs[1]:refresh() }         
                     
  ENDTASKGROUP
  
return nil
 

Re: Refresh on WebView

Posted: Sat Aug 26, 2023 11:26 am
by Ari
Ok,

:D

Grato.