You need to sign in to do that
Don't have an account?
Jyothsna Reddy
How to add values entered in textbox ,surrounded by apex:repeat as shown <apex:repeat ><apex:inputtext/></apex:repeat> to the list in controller
Hi all,
Here I am using Custom controller.
Since there are 5 records in mappingList .It is showing 5 textboxes.How can I add the text entered in textboxes to List.
I am getting only the last value in controller.Here I dontknow how to add these values to array....
-----Please attach the printscreen----------
Here I am using Custom controller.
Since there are 5 records in mappingList .It is showing 5 textboxes.How can I add the text entered in textboxes to List.
I am getting only the last value in controller.Here I dontknow how to add these values to array....
<apex:pageBlock > <apex:repeat value="{!mappingsList}" var="a"> <apex:inputText value="{!textarray}" id="in"/><br/> </apex:repeat> <apex:commandButton value="Save" action="{!myaction}"/> </apex:pageblock>
-----Please attach the printscreen----------
You need to add {!a} in your inputText
Thank you
Kartik
https://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_maps_lists.htm
I tried urs code but I got error as below
Error Error: Unknown property 'a'
I tried the link which u sent.
In that I observed one thing
Here in text they are displaying the values on accountNames.But I want to enter my own text in that textbox and
then I want to add these entered values to an array .how to acheive this....
Can you tell me how the mappingsList is defined in controller?
Thank you
MappinList method definition is here.Plz have a glance
public List<Contact> mapLs{get;set;}
public List<Contact> getMappingList(){
mapLs=[SELECT Name From Contact Limit 5];
return mapLs;
}
I would suggest you to go through the Force.com Fundamentals and workbooks once.
For your problem though,
Not sure if there is a setter method in your controller if you dont have one please add one
Another issue with your SOQL is name is a read only field on Contact, instead you would need to update firstname and lastname.
In your Visualforce page now, you can write something like this
Please make sure its mappingList vs mappingsList as I have seen in your first comment you mentioning it as mappingsList
Hope this helps.
Thank you
Actually,I dont want to use "a.firstname "here as a value
<apex:inputtext value="{!textarray}" rendered="if(a.firstName=='sai',true,false)"/>
so whenever firstname is sai then only this text box will display and whatever I entered here I want it to add to array