New topic: Refresh a page or data in a control by WebTimer?
<http://forums.realsoftware.com/viewtopic.php?t=45268> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message swilson Post subject: Refresh a page or data in a control by WebTimer?Posted: Thu Sep 06, 2012 9:39 am Joined: Fri Aug 10, 2012 9:59 am Posts: 7 I can't seem to locate a method to refresh a page or control so that changes in the underlying data would by auto-magically presented to the user without interaction. I'm presenting some information in a WebListBox and tried selecting a row, setting focus, etc. Ideas? Thanks! Top taylor-design Post subject: Re: Refresh a page or data in a control by WebTimer?Posted: Thu Sep 06, 2012 10:04 am Joined: Wed Mar 22, 2006 11:15 am Posts: 497 Location: Southern California You should be able to drag a WebTimer onto a page, and just set the control in the WebTimer Action event. If this needs to happen repeatedly make sure the WebTimer mode is set to multiple, and the period to some reasonable value in milliseconds. There isn't a page or control refresh. WE is a 100% AJAX web framework. If you change a control in Realbasic (server side) in response to an event, the control should update on the client browser as quickly as network latency allows. _________________ Daniel L. Taylor Custom Controls for Real Studio WE! Visit: http://www.webcustomcontrols.com/ Top swilson Post subject: Re: Refresh a page or data in a control by WebTimer?Posted: Thu Sep 06, 2012 10:09 am Joined: Fri Aug 10, 2012 9:59 am Posts: 7 That's exactly what I tried, but the data doesn't refresh. I'm using the Action event on the timer, and when I include a MsgBox to test the function, it appears as expected based on the period I set. Nothing I call on the WebListBox, however, causes it to refresh the data. I suppose I could delete and add the rows back, but that seems a bit extreme? Top taylor-design Post subject: Re: Refresh a page or data in a control by WebTimer?Posted: Thu Sep 06, 2012 10:26 am Joined: Wed Mar 22, 2006 11:15 am Posts: 497 Location: Southern California Can you post the code from the WebTimer Action event? _________________ Daniel L. Taylor Custom Controls for Real Studio WE! Visit: http://www.webcustomcontrols.com/ Top swilson Post subject: Re: Refresh a page or data in a control by WebTimer?Posted: Thu Sep 06, 2012 10:44 am Joined: Fri Aug 10, 2012 9:59 am Posts: 7 The WebListBox gets initially populated by the Open event on the page, and the user can select from different information through a SegementedControl across the top of the page. Too many years working with data bound controls have corroded my circuits. I expected the data to refresh by changing a property on the control as it would in other environments, but now I understand that I will need to reload the data from the WebTimer. Thanks! Top swilson Post subject: Re: Refresh a page or data in a control by WebTimer?Posted: Thu Sep 06, 2012 11:04 am Joined: Fri Aug 10, 2012 9:59 am Posts: 7 FWIW - here's an ugly little hack that solves my problem. If I set the WebListBox List Index to the current value nothing changes, but by changing it to 0 then back to the selected value the Action event of the SegmentedControl is called and updates the date. dim foo as Integer foo = SegmentedControl1.ListIndex SegmentedControl1.ListIndex = 0 SegmentedControl1.ListIndex = foo It ain't pretty, but it works! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
