Question
South Florida Water Management District
US
Last activity: 18 Jan 2017 16:05 EST
How to avoid duplicate selections from a dropdown list
Hi,
We need to avoid duplicate selections from a dropdown list (this list is populated from a report definition). Any ideas how can we do this?
Thank you,
Maria
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
South Florida Water Management District
US
We worked around it with a Data Transform that will compare the current selection to the previous selection(s). If it is duplicate, we are deleting the current selection. Everything else remains the same. This data transform triggers the user makes a selection. On the "Actions" tab of the dropdown, action set 1, upon "Change", Actions: Post value (default), "Refresh-This section", Target "section", data transform: The name of the data transform.
South Florida Water Management District
US
Hi,
We need to avoid duplicate selections from a dropdown list (this list is populated from a report definition). Or how to delete a selection from the list? and perhaps put it back if the user deletes his/her selection? Any ideas how can we do this?
Thank you,
Maria
Pegasystems Inc.
IN
If the dropdown source is report definition or DataPage of source report def. then you can check "remove duplicate rows" option in Report definition. So the list itself will not have duplicates.
-
Maria Finol PAVAN SANJAY VADLAMURI
South Florida Water Management District
US
The list of choices in the dropdown is unique. But the user can select the same row from the dropdown multiple times, and the user doesn't want to have available the same choice from the dropdown was it was selected. Or at least not be able to select a choice that was previously selected.
Pegasystems Inc.
IN
Hi Maria,
pxDropDown displays whatever the values present in the source. If it's sourced from a Report Definition, all the values corresponding to that column will be displayed. pxDropdown will not check for any uniqueness.
You might have to introduce a mechanism to update the result set and source it to Dropdown.
Ex: Use an activity to filter the results and copy them onto a DataPage.
-
Maria Finol
South Florida Water Management District
US
Hi Shashidhar,
The list of choices in the dropdown is unique. Currentlt, the user can select the same row from the dropdown multiple times, and the user doesn't want to have available the same choice from the dropdown once a choice has been selected. Or at least not be able to select a choice that was previously selected.
Pegasystems Inc.
IN
Hello
are you placing the dropdown inside a grid ?
South Florida Water Management District
US
Hi, yes the dropdown is inside a Grid Repeat Layout.
IN
Hello Maria,
You can configure an on change-run activity action set on the dropdown and in this activity you can update the source of the DD. For example, lets say there is a dropdown with 5 values (A,B,C,D,E), mapped to a DataPage DP1. So when user selects any value from the dropdown, say A, then set the value of a temporary variable/property, say TempAlreadySelectedValue and pass it to the DataPage DP1 as parameter. Have a logic on this Data Page such that it won't have the value in its list which has been passed as parameter. But make sure, not to do the refresh section as it will remove the already selected value from DropDown.
South Florida Water Management District
US
This makes sense. I will also have to refresh the DD again, when the user diselects a choice...
Accepted Solution
South Florida Water Management District
US
We worked around it with a Data Transform that will compare the current selection to the previous selection(s). If it is duplicate, we are deleting the current selection. Everything else remains the same. This data transform triggers the user makes a selection. On the "Actions" tab of the dropdown, action set 1, upon "Change", Actions: Post value (default), "Refresh-This section", Target "section", data transform: The name of the data transform.