Hi,
I'm creating Interactive Automation Script in MVP style. In that script I have script parameter which will contain layout ID. Every layout has different number of boxes.
When I get layout ID, I know how many boxes that layout has and in interactive automation script I need to show to user something like table where user can select item from DropDown and add it to box of layout.
Example:
I have 2 Layouts. First layout with ID:1 have 5 boxes, and second layout with ID:2 have 2 boxes.
When interactive automation script is triggered and have script parameter value:1, in UI I need to display 5 rows with label Box ID (from 1 to 5) and DropDown for each row where will be listed all items.
The problem is that number of boxes are always different and I need DropDown property for every box in View module. So, if layout have 40 boxes, I will need 40 properties in View module.
Does someone know better way to do something like this without creating maximum number of boxes in layouts in View module?
Hi Dario,
How about adding some small methods to the view to add/remove the dropdown rows to the view, and also a method or property to get a list of your dropdowns again.
You want the presenter to be responsible for adding the correct number of rows to the view, and the view to be responsible for the positioning of the dropdowns that are getting added.
With this, you can make your view more dynamic without adding domain (model) logic to it.