Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread TServerRequest - running in loop
Thu, Sep 6 2018 10:49 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi All,

I have a serverrequest i am using to display pdf, and update data in a
table (same request - different params). Displaying pdf runs fine
(single run), but updating data in a table seems to run again multiple
times. I am closing the dbisam query and closing the session on module
destroy, so i am in doubt what can cause it running more than once?

Thanks in advance.

Regards,
Hüseyin
Thu, Sep 6 2018 10:56 AMPermanent Link

Walter Matte

Tactical Business Corporation

Are you taking along time to respond?  

Use Fiddler to see what is happening.

Walter
Thu, Sep 6 2018 11:06 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Walter,

It updates the table once, several seconds later it updates again.. i
only want it should update once Smile
Also oncomplete seems to be ignored, i have following:

 if Request.StatusCode <> HTTP_OK then begin
  Request.Cancel;
  window.alert('Error!..');
  end
  else
  begin
  Showmessage('OK!');
  end;
  end;

Nothing happens, no error message or ok message, but i can see data are
updated behind (table)..
Maybe to be noted that i am using internal IDE webserver, but it should
not have any difference?

Regards,
Hüseyin

Den 06-09-2018 kl. 16:56 skrev Walter Matte:
> Are you taking along time to respond?
>
> Use Fiddler to see what is happening.
>
> Walter
>
Thu, Sep 6 2018 2:20 PMPermanent Link

Raul

Team Elevate Team Elevate

On 9/6/2018 11:06 AM, Hüseyin Aliz wrote:
> It updates the table once, several seconds later it updates again.. i
> only want it should update once Smile

Use browser debug tools - they show you exactly what is going on in
terms of request and response

Raul
Thu, Sep 6 2018 7:07 PMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Raul,

Thanks for input. Maybe i am using wrong method for the server request?
I am using rmGet currently for both displaying pdf and for updating data.

Regards,
Hüseyin


Den 06-09-2018 kl. 20:20 skrev Raul:
> On 9/6/2018 11:06 AM, Hüseyin Aliz wrote:
>> It updates the table once, several seconds later it updates again.. i
>> only want it should update once Smile
>
> Use browser debug tools - they show you exactly what is going on in
> terms of request and response
>
> Raul
Thu, Sep 6 2018 7:34 PMPermanent Link

Raul

Team Elevate Team Elevate

On 9/6/2018 7:07 PM, Hüseyin Aliz wrote:
>
> Thanks for input. Maybe i am using wrong method for the server request?
> I am using rmGet currently for both displaying pdf and for updating data.
>

I assume it's your own back-end so you can do whatever you want - EWB
does not really mind as long as server returns proper response codes.

As a good practice using REST style commands is better though.

For example with Chrome
- load your app
- hit F12 to access browser debug tools
- go to network tab
- do your app data modification and save
- you should see in browser network tab how many requests went out
- for each you will see headers, request and response

This would be my 1st step in troubleshooting this

Raul
Fri, Sep 7 2018 9:47 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Raul,

Thanks. It seems that following line just after update table was enough
to get it fixed (runs only once now) Smile

SendContent('');

Found it in a old message / different issue from Uli Becker  (Thanks Uli).

Regards,
Hüseyin

Den 07-09-2018 kl. 01:34 skrev Raul:
> On 9/6/2018 7:07 PM, Hüseyin Aliz wrote:
>>
>> Thanks for input. Maybe i am using wrong method for the server
>> request? I am using rmGet currently for both displaying pdf and for
>> updating data.
>>
>
> I assume it's your own back-end so you can do whatever you want - EWB
> does not really mind as long as server returns proper response codes.
>
> As a good practice using REST style commands is better though.
>
> For example with Chrome
> - load your app
> - hit F12 to access browser debug tools
> - go to network tab
> - do your app data modification and save
> - you should see in browser network tab how many requests went out
> - for each you will see headers, request and response
>
> This would be my 1st step in troubleshooting this
>
> Raul
>
Fri, Sep 7 2018 10:45 AMPermanent Link

Raul

Team Elevate Team Elevate

On 9/7/2018 9:47 AM, Hüseyin Aliz wrote:
> Thanks. It seems that following line just after update table was enough
> to get it fixed (runs only once now) Smile
>
> SendContent('');
>

Great. Your module was not returning any data at all to EWB so that
would make sense.

Raul

Image