Dropdown in repeating grid reset after row delete
In a grid, rows are editable based on a few conditions. On deleting a row, the dropdown value in the editable row is reset automatically and the selected value is lost.
Steps to Reproduce
- Configure a grid with one column having a section include and another column with text input control.
- In the included section, add two dropdown controls. One control is read only, while the other is editable based on the input field value.
- For the editable dropdown, add a load behavior as 'After Screen Render' and dropdown source as a parameterized datapage.
- Add a dropdown action as an OnChange post value.
- In grid action top, add a button. For example, GetValue with OnClick refresh section Run activity.
- Run the use case.
- Add a new row and enter a value to the input field column.
- Click the GetValue button.
- Change the dropdown value in the newly added row.
- Delete the previous row.
A software use or operation error.
Non-editable rows (four) are imported to the grid. A new row is added by clicking the Add New Row icon.
When the first row is deleted, the last editable row's dropdown value is not lost. However, when the row which is immediately before the editable row is deleted, the dropdown value is reset.
The After Screen Render triggers an asynchronous call to the getDropdownOptions activity when there is an update or refresh action on the row or the grid itself. Even when the dropdown has changes, because of the row action or grid refresh, the activity is called N number of times. The reported behavior occurs due to the number of editable rows present in the table.
In this use case, the dropdown is present in the section include in the grid column. Screen render (defer load) is not required since the dropdown itself does not display on load and gets its value OnClick of the grid action top button.
Perform the following local-change:
Modify the dropdown load behavior to On Screen Load (Default).