auto refresh does not refresh query grid for BO or process

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

auto refresh does not refresh query grid for BO or process

Post by swiftinitpvtltd »

auto refresh does not refresh query grid for BO or process.
I have seen this happening few times, does anyone know how to fix this issue?
I have BO and process update set in auto refresh and even though process updates and BO updates query data does not until I refresh page.
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: auto refresh does not refresh query grid for BO or process

Post by swiftinitpvtltd »

I found a nice kendo work around-
Need to exec script anywhere in javascript of grid or close button js and by adding css as kendomaster in query grid

$('.kendomaster').data('kendoGrid').dataSource.read();
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: auto refresh does not refresh query grid for BO or process

Post by hpl123 »

Very nice indeed
Henrik (V8 Developer Ed. - Windows)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: auto refresh does not refresh query grid for BO or process

Post by tford »

I'm curious if others have experienced an auto refresh issue. I have not noticed it.
Tom - V8.8 build 3137 - MySql / PostGres
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: auto refresh does not refresh query grid for BO or process

Post by rbross »

Where is the process being call from and when? Is the user doing something to trigger the call to the process?
If the process is not called by something the user does then AwareIM will not recognize this and a refresh will not happen.
This I learned recently from vlad.
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: auto refresh does not refresh query grid for BO or process

Post by PointsWell »

rbross wrote: Sat Nov 07, 2020 12:21 am Where is the process being call from and when? Is the user doing something to trigger the call to the process?
If the process is not called by something the user does then AwareIM will not recognize this and a refresh will not happen.
This I learned recently from vlad.
There are a few limits to auto refresh

On Save - the user must have a form open, if it is saved via a process it won't update.
On process - the process must be a top level process, initiated by the user e.g. if you have Process 1 calling Process 2 then auto refesh should be on Process 1, the grid isn't aware of Process 2 running.
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: auto refresh does not refresh query grid for BO or process

Post by swiftinitpvtltd »

rbross wrote: Sat Nov 07, 2020 12:21 am Where is the process being call from and when? Is the user doing something to trigger the call to the process?
If the process is not called by something the user does then AwareIM will not recognize this and a refresh will not happen.
This I learned recently from vlad.
Thanks, I think If the process is not called by something the user does then AwareIM will not recognize this and a refresh will not happen.-this was my issue. I have seen this happening few times(90% times it works) before but I have now good workaround and I know exact reasons thank you.
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: auto refresh does not refresh query grid for BO or process

Post by ACDC »

I found a nice kendo work around-
Need to exec script anywhere in javascript of grid or close button js and by adding css as kendomaster in query grid

$('.kendomaster').data('kendoGrid').dataSource.read();
Top
I tried this and it works to some extent, but it does not do what a Refresh button does on the grid

I have a calculated column which is not updating when a value in the grid changes, If I click the Refresh button on the grid it works as desired

How can I programmatically call the exact same function as the Refresh Button. At the moment I am forced to tell the user to click the refresh button to update the column calculation ( Also if I try save the form without clicking the Refresh Button , I get an error: form has changeed forcing me to hit Refresh)... Auto Refresh setting dont always work!

I can SAVE a form programmatically, WHY can't I REFRESH a form programatically. Surely we can get a function to do this, something like EXEC_SCRIPT 'AwareApp.refreshForm();' or 'AwareApp.refreshGrid();
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: auto refresh does not refresh query grid for BO or process

Post by hpl123 »

ACDC wrote: Mon Nov 09, 2020 10:08 pm
I found a nice kendo work around-
Need to exec script anywhere in javascript of grid or close button js and by adding css as kendomaster in query grid

$('.kendomaster').data('kendoGrid').dataSource.read();
Top
I tried this and it works to some extent, but it does not do what a Refresh button does on the grid

I have a calculated column which is not updating when a value in the grid changes, If I click the Refresh button on the grid it works as desired

How can I programmatically call the exact same function as the Refresh Button. At the moment I am forced to tell the user to click the refresh button to update the column calculation ( Also if I try save the form without clicking the Refresh Button , I get an error: form has changeed forcing me to hit Refresh)... Auto Refresh setting dont always work!

I can SAVE a form programmatically, WHY can't I REFRESH a form programatically. Surely we can get a function to do this, something like EXEC_SCRIPT 'AwareApp.refreshForm();' or 'AwareApp.refreshGrid();
I would also ideally do it via an awareapp function so if that exists, support please chip in?

Currently I do the following which works IF you only have 1 grid with a refresh button (it can probably be made to target specific grids as well):

Code: Select all

function AwareRefreshQuery ()
{
$('.k-pager-refresh').click();
}
Henrik (V8 Developer Ed. - Windows)
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: auto refresh does not refresh query grid for BO or process

Post by Jaymer »

ACDC wrote: Mon Nov 09, 2020 10:08 pm I can SAVE a form programmatically, WHY can't I REFRESH a form programatically. Surely we can get a function to do this, something like EXEC_SCRIPT 'AwareApp.refreshForm();' or 'AwareApp.refreshGrid();
bump.
anyone make any progress on this?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: auto refresh does not refresh query grid for BO or process

Post by aware_support »

You can define an operation (panel operation or an operation on item) of the type "Execute Script". Then write the following script:

parser.refreshData ();
Aware IM Support Team
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: auto refresh does not refresh query grid for BO or process

Post by hpl123 »

aware_support wrote: Tue Jan 18, 2022 5:11 am You can define an operation (panel operation or an operation on item) of the type "Execute Script". Then write the following script:

parser.refreshData ();
I have tried this and it works but it seems as though data is reloaded from the server, is that correct? i.e it's not the form that is "only" redrawn? Is there some way to have the form be redrawn only from a JS function?

When I tried it I for example had an input with a value in it (value that was not saved to DB) and when I ran parser.refreshData the form was refreshed and the data cleared.

In my use case I have a form with stretch to bottom enabled and works when the form is initially loaded but then for some reason when doing some things on the form, the dimensions change. This is on a mobile where the virtual keyboard when expanded change the dimensions of the form and when the keyboard is collapsed again, the dimensions doesn't change back. I need some way to do the stretch to bottom again. When I do parser.refreshData, the form and stretch to bottom works again but the input is cleared.
Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: auto refresh does not refresh query grid for BO or process

Post by aware_support »

Yes, the data is loaded from the server. There is no way to juts "refresh" the form.
Aware IM Support Team
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: auto refresh does not refresh query grid for BO or process

Post by hpl123 »

aware_support wrote: Tue Jan 18, 2022 10:49 pm Yes, the data is loaded from the server. There is no way to juts "refresh" the form.
Thanks and I managed to work around it. Do you (anyone?) know off the top of your head which function or calculation the stretch to bottom uses (or where to look? Is it kendo?) when a form is loaded? The problem I have is with a query on a form and the query has stretch to bottom enabled and again works when the initial form is loaded but then after the keyboard is operated, the height of the query is not adapted back to where it was.

What I did was create a function that saves the height of the query when it is initially loaded and then when the keyboard is collapsed, another function set the height of the query to the saved height value. Works better than before but is still not ideal as the form overall height is also changed when doing these custom height set operations so I get double scrollbars etc..
Henrik (V8 Developer Ed. - Windows)
Post Reply