B4J Question ServerExampleNoMySql

Johan Schoeman

Expert
Licensed User
Longtime User
I am testing the B4J app from here (ServerExampleNoMySql) and got it working.

https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/

I start the app and all if fine and working

I start Internet Explorer (11) and browse to

http://165.73.64.74:54021/reports/google_charts.html

I see the chart perfectly. I then stop the B4J process (leaving IE browser alive) and change the Pie Chart code to:

B4X:
Private Sub CreatePieChartData(cols As List, rows As List)
    cols.Add(CreateColumn("", "Topping", "string"))
    cols.Add(CreateColumn("", "Slices", "number"))
    rows.Add(CreateRow(Array As Object("Mushrooms", 3)))
    rows.Add(CreateRow(Array As Object("B4X", 1)))            'was Onions
    rows.Add(CreateRow(Array As Object("Olives", 1)))
    rows.Add(CreateRow(Array As Object("Zucchini", 1)))
    rows.Add(CreateRow(Array As Object("Pepperoni", 2)))
End Sub

So, I am only changing "Onions" to "B4X". I then run the B4J app again and refresh the IE browser. It still shows "Onions" and not "B4X".

If I however (while the B4J process is still running - i.e not killing it) close IE and restart IE then the new Pie Chart has the correct legend - it then shows "B4X" and not "Onions".

Am I missing something here? Why does the change from "Onions" to "B4X" only takes place when I stop and restart IE?

Rgds

JS
 

Cableguy

Expert
Licensed User
Longtime User
I would say "cached values" in IE...

Try, without closing the active or page, to open it in a new tab..
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
I would say "cached values" in IE...

Try, without closing the active or page, to open it in a new tab..
Same result - it does not reflect the change when a new tab in IE is opened.
 
Upvote 0

jimmyF

Active Member
Licensed User
Ctrl-F5 maybe?
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
And if you open on a different window?
The behaviour is clearly a cache thing
Different/new Window makes no difference. Still shows the same "legend" and not the "changed" legend.
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Does it happen with other browsers -Chrome,Firefox- ? Maybe the caching system works differently on IE
Interesting - it works with Chrome...So why does IE not "refresh" the same as what Chrome does? How does one get around this issue to ensure IE responds the same way as Chrome?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The problem is in the ajax calls. Add: cache: false

Example:
B4X:
$.ajax({
               url: "chartsHelper?type=bar",
               dataType:"json",
               cache: false,
               success: function(result) {
                   var data = new google.visualization.DataTable(result.data);
                   var chart = new google.visualization.BarChart($("#bar_chart")[0]);
                   chart.draw(data, result.options);
               }
           });

This goes to the google_charts.html file.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
So why does IE not "refresh" the same as what Chrome does?
Because it is IE! It never worked like other Browsers. That´s the reason i do NOT use IE at all.
 
Upvote 0
Top