You need to sign in to do that
Don't have an account?
mylucky
Update a Value in Dynamic Picklist
How can we update a value in the dynamic picklist..??? I am explaining my requirement here.
List<SelectOption> abc = new List<SelectOption>();
abc.add(new SelectOption('apex',ApexDevelopment);
Now I have to change the 'ApexDevelopment' value to 'VisualforceDevelopment' by removing the value ApexDevelopment in the picklist.
I tried "abc.remove(apex)", it shows an error as : Method does not exist or incorrect signature: [LIST<System.SelectOption>].remove(String)
Can any one help me pls.......
Thanks in advance,
Lakshmi Reddy. B
Lists don't have the ability to remove by "key". Best you can do with remove is call abc.remove(0) which will remove an item from the list based on index/position...and that's only if you know that the apex select option is the first value in the list.
You're other option would be to just reinitialize the abc list and repopulated it with the correct values.