539
Views
14
Comments
Solved
Dropdown Search remember selected value

In reactive I have a dropdown search widget that displays clients. When selecting a client I display some results witin an aggreate according to the selected client id. 

When the user navigates to another screen and then comes pack to the screen with the dropdown search widget I would like the dropdown search to remember the selected client id and display the aggreate with the corresponding result. 

UPDATE: The purpose of the desired functionality which I'm trying to achieve is that ones the user returns to the page he/she shouldn't have to re-select the former value (inside the dropdown search widget) in order to view the same result set inside the aggerate. I want the screen to remember the value he/she has selected and the corresponding result set.  




Thanks

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Mohammad,


I am sending to you a working example OML. It will be easier for you to see how it works.

First, make sure you have the client variable filled in as the Starting Selection and that you have the handler for the OnChanged event:


Then on the handler, you update the value of the client variable:


And that's it.


Kind Regards,
João

ReactiveSandbox12.oml
2018-10-29 08-31-03
João Marques
 
MVP

Hi Mohammad Mirza,


Instead of using a local variable to hold the option selected by the user (the client id) in your case, use a client variable.

While the local variable resets to its original value when you navigate to a screen, the client variable holds the data until the user signs out of the app or when the platform signs out the user automatically.


Kind Regards,
João

2024-09-13 15-32-30
Mohammad Mz

Hi João 

This is exactly what I have done. However I've ran into problem with assigning the value to the dropdown search widget. 

I have tried to assign the client variable inside the Initialized event of the dropdown search widget (on the DropdownWidgetId parameter) and I have also tried to do it on the "On After Fetch" of the GetClients aggregates. But it does not seem to be the correct procedure. 

2018-10-29 08-31-03
João Marques
 
MVP

Hi Mohammad,


You are probably overwriting the value in one of these places.

The client variable will hold the value of your selection, so you don't need to manipulate it on the OnInitialize nor on the OnAfterFetch.


Kind Regards,
João

2024-09-13 15-32-30
Mohammad Mz

I have no problem saving the selected value inside a client variable. The problem is when the user navigates to another screen and then returns, then I need to somehow assign the saved value inside client variable to the dropdown search widget and have the dropdown search widget display the same result that the user had selected to begin with. 

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Mohammad,


I am sending to you a working example OML. It will be easier for you to see how it works.

First, make sure you have the client variable filled in as the Starting Selection and that you have the handler for the OnChanged event:


Then on the handler, you update the value of the client variable:


And that's it.


Kind Regards,
João

ReactiveSandbox12.oml
2024-09-13 15-32-30
Mohammad Mz

Hi João

Thanks for the detailed explanation. That solved my issue. 

Thanks 


2024-02-22 23-38-31
Rahman Brussolo


Now it's clear, it solved me here too, thank you

2022-06-23 06-21-50
Siddharth Vyas

Hi,
Can you provide the OML for the same ?

Thanks

2024-09-13 15-32-30
Mohammad Mz

Hi Siddharth Vyas 

Unfortunately I'm not able to share the OML due to company policy. 

2023-10-26 15-12-53
Mohammed Rizwan

Hello @Mohammad Mirza 

In dropdown search you can use starting selection  properties to show pre selected items

Thanks Regards 

Mohd Rizwan


2024-09-13 15-32-30
Mohammad Mz

Hi Mohd Rizwan

I'm not sure I understand your suggestion. The startingselection property takes a list. What I have is the selected value of the dropdown search which I have saved inside a client variable. 

2023-10-26 15-12-53
Mohammed Rizwan

I have attached the oml for your refrence please look into it i have created a sample for what you are looking.

Demo Link:    Screen

samplePoc_.oml
2024-09-13 15-32-30
Mohammad Mz

Hi Rizwan

Thanks for the OML, however it is giving me errors, even after updating it. 

Nevertheless my issue has already been solved my João Marques.

Thanks


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.