Hi All,
in Odc want to refresh the below for on each dropdown selection,
Above is the dropdwon item selected and highlighted at the bottom of the dropdown,
On each selection when I click the below for to be refreshed and the data to be passed only for that selection,If I select the second selection the form to be refreshed again and the data to be be passed for all the selections,
Can anyone please suggest how to refresh the form based on the dropdown selection each time,
Regards
Hi @Preeti zade ,The Screenshot not shows anything.are you using dropdown search or multiselect dropdown?
Rahul
Hi Rahul,
Its Normal Dropdown,
and I wanted to highlight the selected one on each selection.
All selected ones will appear at bottom of the field.
On each selection of that element The below form has to be refreshed.
Then I ahve to fill all the respective form of each selected element and to pass all data to backend,
The screenshot doesn't show much. If the second form is a block, refresh its data in the on parameters changed with the dropdown select variable as an input value.
Agree with them the screenshot, doesn't show anything so we will need to imagine a little, so you have the OnChange in the dropdown Inside the action, you can handle the refresh of the form, Im not sure if you're using a separate block if the answer is yes, you can use the OnParameterChange event of the block as @Gireesh Kumar P suggested, if not and if you're using for example Aggregates you can just refresh them like this:I hope it helps or maybe it can help you to have a better idea.
Hello @Preeti zade
Samuel already gave you a potential solution.
It's important to notice there is no "form refresh" in reactive/odc. The controls in a form are bound to variables. If the variables are changed in your logic, the controls in the form will automatically update.
So, first, you need to decide how you want to hold the selections. Is the number of drop downs fixed or are they in a loop and can vary? In the first case, you can have one variable for each drop down. In the second case, you probably need a list. But if you are already fetching data to show the drop downs (a list), you can add a column to this list to store the drop down selection.
After that, you need to decide how you want to "populate" the form. If the form has a fixed number of inputs is one thing, if it need to have a "list" of inputs for each drop down selection, you will have the same situation as with the drop downs. In this case, you probably want to have a local list and append an element with the data you want to show to it when the user make a selection.
But depending on where is your data, particularities of your app, etc, you may need a different solution.
From what you said is difficult to help you more than that without guessing what is your scenario.
You may make things easier if you give examples of what must happen if the user select one drop down, if it selects two, etc.
cheers!
Hello,
As an ex,Considering below dropdown the selcted values will appear in the bottom of dropdown,
So assuming expression as a list of selected items ,so for each selected item when I click on each element ,the below form should be refreshed(Separte form for separate element),
All the below elements including dropdwon are in block.So the individual structure as a list to be send to back end,Each record of dropdown value with form values.
Let me see if I understood.
You have 1 drop down that the user can select different multiple items.
Every time it selects an item, it should appear in the "expression list" (I am assuming it is a list)?
And when you click on one expression, it should show data associated to the element clicked in the form?
If so, a possibility could be like this:
First thing, you need a local list (SelectedList) for the items that are being selected. This list should be a structure that holds the selected item ID and Label, but also the data that must be associated to the selected item and that should be displayed in the form when the user clicks the item.
Every time the user selects an item of the drop down, use the OnChange of it to set an action local variable of the type structure with the values (id, and label) and append it to the SelectedList list. I would set the drop down variable to NullIdentifier() so it would be empty again allowing the user to select another item.
Use a list widget on the screen, bound to this SelectedList, and the item will appear automatically.
In the list widget, add a link around the expression, and set the destination to a screen action.
In this action, set the value of a screen local variable with the same structure of the local list (SelectedItem), and bound this screen local variable to the inputs in the screen.
Every time the user clicks the expression, it will show the data in the form.
Problem: What if the user can change the data in the form?
In this case, you will need a button to save the changes, and in the action you will have to use the ListIndex to find the element in the list based on the id, and using the form SelectedList[index] you can then change the values in the list.
When submitting, you can send the list to the back end.
Is this what you need?This would be my first approach (doing it from my head), but probably you can improve this.
Cheers!
This is handled with record list
Thank you