10-30-2019, 05:14 AM
(This post was last modified: 10-30-2019, 10:09 AM by cprmlao@hotmail.com.)
With IW 15.1.17
I have a handler, a Form using a Html TemplateForm and a JS code used in document.ready().
I have in my app many handlers.
In the local network and with amazon EC2 I am using WIFI with my home router. I am not using internet provider from mobile.
I am having randomic "404 error" with "resource not found" when using the app with the chrome browser in my mobile and Amazon EC2 Server.
Sometimes the Handler works, other times doesn´t work. When I tried debug I see it is trowing an error of "404 - resource not found", randomically.
If I use the Chrome Desktop or my mobile with chrome connected with IW server installed in a PC in the local network, there is no problem.
If I use the Chrome Desktop connected with IW server installed in Amazon EC2 , I have no problem.
The problem only occur when using chrome browser of my cell phone and IW server in Amazon EC2.
I have noted that the problem happens when I use the crome browser of my mobile. If I use the default browser of my mobile there is no problem.
I have Android Oreo in the mobile and it is a recent Cell phone. So Chrome os updated in version 78.0.3904.62
What can be causing it?
//IW Handler
//JS code in html Template Form
I have a handler, a Form using a Html TemplateForm and a JS code used in document.ready().
I have in my app many handlers.
In the local network and with amazon EC2 I am using WIFI with my home router. I am not using internet provider from mobile.
I am having randomic "404 error" with "resource not found" when using the app with the chrome browser in my mobile and Amazon EC2 Server.
Sometimes the Handler works, other times doesn´t work. When I tried debug I see it is trowing an error of "404 - resource not found", randomically.
If I use the Chrome Desktop or my mobile with chrome connected with IW server installed in a PC in the local network, there is no problem.
If I use the Chrome Desktop connected with IW server installed in Amazon EC2 , I have no problem.
The problem only occur when using chrome browser of my cell phone and IW server in Amazon EC2.
I have noted that the problem happens when I use the crome browser of my mobile. If I use the default browser of my mobile there is no problem.
I have Android Oreo in the mobile and it is a recent Cell phone. So Chrome os updated in version 78.0.3904.62
What can be causing it?
//IW Handler
Code:
function TContentAgenda.Execute(aRequest: THttpRequest; aReply: THttpReply;
const aPathname: string; aSession: TIWApplication;
aParams: TStrings): boolean;
var
jso,js:TJsonObject;
ja:TjsonArray;
begin
Result:=True;
js:=TJSonObject.Create;
ja:=TjsonArray.Create;
try
with Controller.DM.FDQQuery do begin
Close;
SQL.Clear;
SQL.Add('Select A.* from TableTeste');
.....
js.AddPair('draw',TJSONString.Create(_draw));
js.AddPair('recordsTotal',TJSONString.Create(....));
js.AddPair('recordsFiltered',TJSONString.Create(....));
js.AddPair('data',ja);
wresult:=js.toJson;
Close;
finally
js.Free;
end;
aReply.WriteString(wresult);
end;
//JS code in html Template Form
Code:
<script>
$(document).ready(function () {
function listaAgenda() {
let params = {
data_inicial: moment().format('DD/MM/YYYY'),
data_final: moment().add(1, 'days').format('DD/MM/YYYY'),
med_ag: $('#IWUSU').val() || ''
};
//encodeURI
$.ajax('/GetAgenda?' + encodeURI($.param(params)))
.done(resp => {
let out = JSON.parse(resp);
let context = { qtde: out.recordsFiltered, items: out.data };
context.hasItems = (parseInt(context.qtde, 10) > 0);
let html = template_agenda_script(context);
$("#id_agenda_menu").html(html);
}).fail(erro => {
alert(JSON.stringify(erro))
})
};
listaAgenda()
})
</script>