You need to sign in to do that
Don't have an account?
srinivas pulipati
public class ListExamples {
public set<string> name{set;get;}
public ListExamples(){
List <string> mylist =new List<String>();
mylist.add('sakthi');
mylist.add('sreenu');
mylist.add('vamsi');
set<String> name = new set<string>();
name.add('one');
name.add('two');
name.add('three');
name.addAll('mylist');
}
}
Vf Pgae:
<apex:page controller="ListExamples" >
<apex:form >
<apex:pageblock >
<apex:pageBlockTable value="{!name}" var="a">
<apex:column colspan="2" value="{!a}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
Error:
Method does not exist or incorrect signature: [Set<String>].addAll(String)
hi i am writing apex program and vf program but error is came how to solve this error
public class ListExamples {
public set<string> name{set;get;}
public ListExamples(){
List <string> mylist =new List<String>();
mylist.add('sakthi');
mylist.add('sreenu');
mylist.add('vamsi');
set<String> name = new set<string>();
name.add('one');
name.add('two');
name.add('three');
name.addAll('mylist');
}
}
Vf Pgae:
<apex:page controller="ListExamples" >
<apex:form >
<apex:pageblock >
<apex:pageBlockTable value="{!name}" var="a">
<apex:column colspan="2" value="{!a}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
Error:
Method does not exist or incorrect signature: [Set<String>].addAll(String)
You syntax is wrong:
Change this:
name.addAll('mylist');
To this (remove the single quotes):
name.addAll(mylist);
Thx
Srinivas, it looks like you are new to this forum,
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Good luck!!!
Thanks