Solved

Refresh of WebUI page

  • 3 August 2022
  • 1 reply
  • 45 views

L.S.

 

I would like to make a procedure running through aset of modelled years. After change of a year I would like to refresh an output web ui page with the data of the then current year.

In the for loop I implemented a delay of a couple of seconds but the WebUi page is not refreshed.

How can I arrange that the WebUi is refreshed each time a new year is set.

 

Many tnanks for your support

Best regards

Nort

 

for st do
    epSelectedYear := st;
    Delay(2);
endfor;

 

P.S. The function PageRefreshAll does not work apparently for WevUI pages

icon

Best answer by Edo Nijmeijer 4 August 2022, 14:55

View original

1 reply

Userlevel 4
Badge +3

Hello Nort, thanks for putting this question out on the community. Since it highlights some product features that seem obvious but turn out to be far less so.

Being an WebUI front-end guy I wasn’t really aware of how this procedure might behave, so I did some asking around.

First of all, and you already correctly compared it to WinUI here, there will be no updates, to anything ‘UI’, while this procedure is running. Only after finishing it. So it definitely won’t work in its current shape.

For WinUI, your way out would be adding a call to the PageRefreshAll function.
For WebUI it does not exist and from what I’ve heard from my colleagues it would also be pretty hard to know which and how many ‘locks’ to undo while refreshing. So not a feature we’re likely to spontaneously extend to WebUI, or built separately, any time soon.

 

So what are your options then?

From the modelling angle I might suggest using a combination of delay and scheduleAt. That should free up the engine to propagate updates, but I suspect they might be less ‘immediate’ then you require.

Another, pretty unconventional approach, might be to do your ‘timed loop’ from within a piece of client-side custom JavaScript. Something which would ‘monitor’ some widget, or take values from it, and then let the JavaScript set other values that can be sent back to the model. Causing updates again elsewhere.
However, this doesn’t feel like something you want to build and maintain for the long run. And I’m also unclear as to how the javascript would have access to the correct values and settings.

So I hope the scheduleAt suggestion helps you towards creating a working solution.

And you could still submit your idea to be able to PageRefreshAll in the ideas section of the community. Our Product Owners will be able to take it up for sizing and consideration for our backlog.

 

 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator