Screen Refresh after Local Storage Value Change

Use this Forum to post your “How to …” questions about your use of aXes. This is not a technical support forum. Both the aXes Support Team at LANSA and other aXes customers may answer your questions. LANSA cannot guarantee the accuracy of any information posted by customers.

Moderator: jeanmichel

Post Reply
dylan.ramirez
Posts: 7
Joined: 15 Nov 2022, 16:03

Screen Refresh after Local Storage Value Change

Post by dylan.ramirez »

Good Day Everyone.
I had some issue regarding a local storage value. Is that possible to refresh the aXes screen without loading the whole page every time the local storage value is changed?

As you see the attached picture, I want to automatically change the value of the date field at the left side of the screen depends on the selected date from date field at the right side of the screen.
Attachments
Screenshot_2.png
Screenshot_2.png (30.97 KiB) Viewed 4904 times
dylan.ramirez
Posts: 7
Joined: 15 Nov 2022, 16:03

Re: Screen Refresh after Local Storage Value Change

Post by dylan.ramirez »

Hi folks,
I already got the solutions by using the FIELDS() event and the refresh function.

windows.onStorage{
const variable = FIELDS("fieldname");
variable.refresh();
}
tim mcentee
Posts: 40
Joined: 26 Jul 2017, 13:20

Re: Screen Refresh after Local Storage Value Change

Post by tim mcentee »

Hi Dylan

A few things.
1) using const is not correct. a field object is a changeable object - ie .refresh() - so you should use variable assignment let rather than const.
2) listening to the global windows.onStorage event means that the field will be refreshed when the screen is active and some activity happens to windows storage.

3) You can access the field directly from the datepicker. In the datepicker event onSelectValueChanged

/* datepicker value */
let txtFromDate = FIELD.getValue();
/* aXes 5250 field object */
let fldFromDate = FIELDS("txtFromDate");
/* set aXes field with datepicker value */
fldFromDate.setValue(txtFromDate);
Post Reply