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.
Screen Refresh after Local Storage Value Change
Moderator: jeanmichel
-
dylan.ramirez
- Posts: 7
- Joined: 15 Nov 2022, 16:03
Screen Refresh after Local Storage Value Change
- Attachments
-
- Screenshot_2.png (30.97 KiB) Viewed 4902 times
-
dylan.ramirez
- Posts: 7
- Joined: 15 Nov 2022, 16:03
Re: Screen Refresh after Local Storage Value Change
Hi folks,
I already got the solutions by using the FIELDS() event and the refresh function.
windows.onStorage{
const variable = FIELDS("fieldname");
variable.refresh();
}
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
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);
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);