[Gambas-user] dynamically timer gb.web.gui

Mayost Sharon sharon at 455.co.il
Thu Dec 24 21:20:31 CET 2020


---------- Original Message -----------
From: Benoît Minisini <g4mba5 at gmail.com>
To: user at lists.gambas-basic.org
Sent: Thu, 24 Dec 2020 19:47:06 +0100
Subject: Re: [Gambas-user] dynamically timer gb.web.gui

> Le 23/12/2020 à 21:50, Mayost Sharon a écrit :
> > Hello
> > 
> > When I dynamically add a timer
> > As the following code:
> > 
> > Export
> > 
> > Public hConsoleTimer As Timer
> > 
> > Public Sub WebForm_Open()
> > 
> >    hConsoleTimer = New Timer As "MyTimer"
> >    hConsoleTimer.Delay = 1000
> >    hConsoleTimer.Enabled = True
> > 
> > End
> > 
> > Public Sub MyTimer_Timer()
> >    
> >    WebLabel1.Text = CString(Now())
> > 
> > End
> > 
> > It went into the event
> > But on the page I do not see the changes of time
> > 
> > If I manually add a timer and put it on the WebForm it works fine.
> > 
> > Thanks
> > 
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >
> 
> It's because the GUI creates a "WebTimer", not a "Timer".
> 
> "Timer" ticks internally in the session server process, and can't force 
> an update of the web browser client, whereas "WebTimer" ticks in the 
> client web browser, and then can update the interface.
> 
> The update of the web page can only be done in a response to a request. 
> It cannot be forced from the server if a request has not been initiated 
> from the web browser, i.e. from a GUI event (bouton click, WebTimer 
> tick...).
> 
> -- 
> Benoît Minisini
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
------- End of Original Message -------

Thank you


More information about the User mailing list