function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nag22Nag22 

How to remove and add the items to the list at the same time?

Hi
I am working on one secnario where I need to remove some items from list at the same time I need to add set of items to the list.

Example
list contains 30 items  1,2,3,4,5,6,7.............30

Each item having Yes, no optons like this

1. some question
Yes (radio buttons)
No

If I click on Yes I need to remove 3,4,5 questions
If I click  on No I need to remove 7,8 and I have to add 3,4,5 to the list questions as well. (both adding and removing should done at same time)

on every click I am rerendering the page.

Help me to figure out this.
James LoghryJames Loghry
Do you have any apex and visualforce you've started with and could share with us?

One thought here is you could use a wrapper class that has a "selected" boolean, similar to this example: https://developer.salesforce.com/page/Wrapper_Class

W
Hen you need to operate over the list of 30 items, then you would just count the selected items, for instance.