Disable reset counter in Icon Badge Widget

Hello all, I need to solve some problem. I don't want reset my bottom bar counter's if user move to another screen. I want keep my bottom bar value. BTW my bottom bar counter fetched from server action. I actually try to solve this problem by using local storage or on initialize in bottom bar, but it's not works -_-.

Have all of you any idea to solve this problem, just comment below.

All of you can check more detail in this link. Anyway I say thanks to all kinds help.

https://drive.google.com/file/d/1XdPFFIJqgOwUMD0fumIjSp9VFLarAglE/view


Best Regards,

Firbert Oktariko

Solution

Hi,

I am unaware of your Implementation, but here's some approach I could have implemented from what high level I got to know.

Approach-1 :

1- Create a block for bottom-bar & declare an inputCounter variable & set it as Mandatory, which will use to set the counter value.

2- On All Screens where you are using the bottom-bar, you will pass the server-Action result to that i.e Counter Value


Approach-2 :

In Approach-1 you will see we are calling the server action multiple times for just the same counter value, so here we can use the local storage.

 Use the SHARED PREFERENCES Plugin available on forge that use native features like Shared Preferences & NSUserDefaults to store key values pairs on Android & iOS respectively. 

The One which we have published Shared Preferences Plugin if you would like to check this out. 

Just like we use the Shared-Preferences with native for storing local & permanent session or values across all screen, you can use this.

Call you Server action once on Initial Screen & store the value & use it across all screens easily.


https://www.outsystems.com/forge/component-overview/5013/android-ios-shared-user-preferences

Approach -3 :

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Maintain_State_while_Navigating_across_Screens

Cheers,

Assif



Solution

assif_tiger wrote:

Hi,

I am unaware of your Implementation, but here's some approach I could have implemented from what high level I got to know.

Approach-1 :

1- Create a block for bottom-bar & declare an inputCounter variable & set it as Mandatory, which will use to set the counter value.

2- On All Screens where you are using the bottom-bar, you will pass the server-Action result to that i.e Counter Value


Approach-2 :

In Approach-1 you will see we are calling the server action multiple times for just the same counter value, so here we can use the local storage.

 Use the SHARED PREFERENCES Plugin available on forge that use native features like Shared Preferences & NSUserDefaults to store key values pairs on Android & iOS respectively. 

The One which we have published Shared Preferences Plugin if you would like to check this out. 

Just like we use the Shared-Preferences with native for storing local & permanent session or values across all screen, you can use this.

Call you Server action once on Initial Screen & store the value & use it across all screens easily.


https://www.outsystems.com/forge/component-overview/5013/android-ios-shared-user-preferences

Approach -3 :

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Maintain_State_while_Navigating_across_Screens

Cheers,

Assif



Hi, Assif

Wow, what an excellent solution. 

I already using your first solution (i think it's a little hardcode but it's okay. I haven't problem about that). It's works. 

Thanks a lot bro. BTW we already be friend in this forum. I hope we can exchange our consideration in future. 

Have a nice day :)


Best Regards,


Firbert Oktariko

Firbert Oktariko wrote:

assif_tiger wrote:

Hi,

I am unaware of your Implementation, but here's some approach I could have implemented from what high level I got to know.

Approach-1 :

1- Create a block for bottom-bar & declare an inputCounter variable & set it as Mandatory, which will use to set the counter value.

2- On All Screens where you are using the bottom-bar, you will pass the server-Action result to that i.e Counter Value


Approach-2 :

In Approach-1 you will see we are calling the server action multiple times for just the same counter value, so here we can use the local storage.

 Use the SHARED PREFERENCES Plugin available on forge that use native features like Shared Preferences & NSUserDefaults to store key values pairs on Android & iOS respectively. 

The One which we have published Shared Preferences Plugin if you would like to check this out. 

Just like we use the Shared-Preferences with native for storing local & permanent session or values across all screen, you can use this.

Call you Server action once on Initial Screen & store the value & use it across all screens easily.


https://www.outsystems.com/forge/component-overview/5013/android-ios-shared-user-preferences

Approach -3 :

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Maintain_State_while_Navigating_across_Screens

Cheers,

Assif



Hi, Assif

Wow, what an excellent solution. 

I already using your first solution (i think it's a little hardcode but it's okay. I haven't problem about that). It's works. 

Thanks a lot bro. BTW we already be friend in this forum. I hope we can exchange our consideration in future. 

Have a nice day :)


Best Regards,


Firbert Oktariko

Thanks Firbert Oktariko,

Happy to know it help n work for you.

Sure will be glad to exchange thoughts & share knowledge with you over here on forum.

Cheers,

Assif