Passing value from axFrame HTML Page back to the AXES Main Page

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
rigor
Posts: 7
Joined: 07 Jul 2021, 12:46

Passing value from axFrame HTML Page back to the AXES Main Page

Post by rigor »

Hi,

Is there a way for axFrame to communicate to the Axes Main Page and pass a value? For example, I've used an axFrame to display a Calendar using JQuery, I was hoping I can pass back the selected data from the Calendar to the AXES Main Page. Is this possible?

Is there a way that we can maybe use a JS Library to store the data selected from the Calendar and have the AXES Main Page access this Library to get the value?

Thanks.
tim mcentee
Posts: 40
Joined: 26 Jul 2017, 13:20

Re: Passing value from axFrame HTML Page back to the AXES Main Page

Post by tim mcentee »

Hi Rigor

axFrame is only available when editing. In User mode whatever you are trying to do will not be avaialable.

Tim
rigor
Posts: 7
Joined: 07 Jul 2021, 12:46

Re: Passing value from axFrame HTML Page back to the AXES Main Page

Post by rigor »

Hi Tim,

Thanks for the response.

We were able to find a work around for the issue. We've used Web Local Storage to pass and store the value and just do an extension refresh to get the value to be displayed to a component.

Please see screenshot below for the example that we made, we can pass back the value from the DatePicker on the axFrame HTML Page back to a text field in AXES, this was tested on both developer and user mode.
IFrame.PNG
IFrame.PNG (384.74 KiB) Viewed 6246 times
Thanks,
Rigor
tim mcentee
Posts: 40
Joined: 26 Jul 2017, 13:20

Re: Passing value from axFrame HTML Page back to the AXES Main Page

Post by tim mcentee »

Hi Rigor

This is a duplicate of my post in screen refresh

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