cowen
New Member
Posts: 1
|
Post by cowen on Nov 22, 2009 7:51:27 GMT -5
Hi Guys, Just started playing with RunBasic and HTML in general. Mainly so that I can display information contained in a small SQLite database.
First thing is, I would prefer not to keep updating the entire web page after reading data from a database. I would prefer just to update the values on screen. I suspect this is not possible without the use of some java, but I desperately want to avoid this.
Secondly, if I run an automatically refreshing page, the data returned the first run is correct. If I leave the page refreshing and change the data in the database, the data displayde never changes. The code I ran was.....
html"<meta http-equiv=""refresh"" content=""2"">" html"<META HTTP-EQUIV=""PRAGMA"" CONTENT=""NO-CACHE"">" sqliteconnect #records, "Records.db" query$ = "select amt from Payables where invoice='123'" #records execute(query$) if #records hasanswer() then print #records nextrow$(",") end if #records disconnect()
Similary, just generating a random number as follows give a unique number the irst run of the page, but the refresh results in the same data being diplayed....
html"<meta http-equiv=""refresh"" content=""10"">" html"<META HTTP-EQUIV=""PRAGMA"" CONTENT=""NO-CACHE"">" x = int(rnd(1)*10)+1 print x
I assumed this was a caching issue but I am new to all of this!
Any help/advice for a enthusiastic nebee would be welcome!!
|
|
|
Post by votan on Nov 22, 2009 9:16:43 GMT -5
You are right, updating just parts of the page without completely reloading is only possible by using AJAX. So, if you want to avoid this, you have to do a full page refresh. And yes, the second problem is caused by RB's internal caching. To avoid this, do not open the page by using the Sessioned url.... just do a fresh call on the project itself or insert a link into your code that makes sure it processes the required piece of code.
|
|
|
Post by StefanPendl on Nov 23, 2009 3:28:26 GMT -5
You can avoid refreshing the whole page, if you use the RUN command to execute a separate module. You can then use the RENDER command to display and update the separate module. This will create a separate object on your page.
|
|
|
Post by kokenge on Nov 23, 2009 5:37:01 GMT -5
The Run command works very effectively. I have some jobs with as many as 20 Runned programs. Even though these are separate modules, you can control how they run between the modules. The browsers display all the data from all the Runned programs. That means using JS you can effect data or push buttons between modules.. If you do decide to use JS, I refer you to this thread. It has a JS that fires up a backend program that can keep your files up to date as you change data. runbasic.proboards.com/index.cgi?action=display&board=general&thread=1099&page=1HTH
|
|