wrote:
wrote:
wrote:
Hi
,A friendly reminder to you regarding the OML you uploaded. You might be associated with an enterprise Company for the Product. Thus uploading a complete Mobile App [Product] is not a good practice from a security & confidentiality point of view. I would suggest you remove it instantly as of it may land your company in trouble with NDA Clauses if it's a Product & not your own Practice app.
Perhaps coming to your issue,
I went through the OML & I would suggest the below approach:
No matter you use JS, you are going to lose the Screen State as of every time the Screen render from a BackStack in Mobile app, it is going to re-start its lifecycle Initially i.e onInitialize
Well, your only requirement is to maintain a state of the Array that you are keeping Append by some data.
So when you navigate from SearchHospitalScreen to MyCalendar, Pass a YourArrayType Param to MyCalendar Screen & Get it back when you come from MyCalendar to SearchHospitalScreen.
1-Declare SearchHospitalScreen with an InputVariable of YourArrayType let's say MyArray
2-Declare MyCalendar with an InputVariable of YourArrayType let's say MyArrayData
3-While you Navigate back to SearchHospitalScreen again pass the MyArrayData as an Input to it.
This way you can maintain the state of the Array via Rotating it between screens & yes the navigation can be kept normal instead of any JS. Once you get back the Array then under onInitialze you can re-use it in & pass it to PlotHospitalonMap Action.
Do let me know if you need more help for the same. I'll try to Implement this on your OML.
Hope it helps,
Assif
Hi Assif,
How do I pass the array while navigating back to the previous screen?
Regards,
Shreyas Bhondve
Moreover, why can't I make use registerBackNavigationHandler in SearchHosital screen which is supposed to be invoked when navigating back from MyCalendar?
How do I pass the array while navigating back to the previous screen?
: Make Input variable on both Screens of Array Type, If you don't see then create a Structure first of that type & then use it.
Moreover, why can't I make use registerBackNavigationHandler in SearchHosital screen which is supposed to be invoked when navigating back from MyCalendar?
: registerBackNavigationHandler - Registers a callback function in a queue to be called when navigating back.
So it is basically used in while you are dealing with Android so that you can identify the back-key event & use this to navigate back.
Remember even though you navigate to the last Screen but in Outsystems while the navigation between the screens, the older screen is always removed from the DOM. Thus the previous Screen will be rendered again from initialize because the DOM of this screen is removed while navigating to other.
Ref:
https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events
This means every child property of Screen i.e Variables or Aggregates will lose the memory & Data while you Navigate to another Screen.
Hope it helps,
Assif