+ Start a Discussion
micwamicwa 

inputText: unlimited number of fields

I have a problem using inputText. I know that you can save and use the value entered in an input field in a member variable of the associated control class. But what happens if I don't know how many input fields I need? Is there another possibility ex. using url parameters passing as many values as needed to the form controler?

Thanks for your help.
Anand@SAASAnand@SAAS
You can use a "List" and use or to capture all the input fields. Once you save, the values are automatically available in your List
micwamicwa
Thanks for your answer, I don't know how I should do that, can you help me?
The following doesn't work:

Page:
Code:
<apex:inputText value="{!inputList}" />

 


Controller Apex Class
Code:
List<String> inputList;

public void setInputList(List<String> pValue){
    inputList= pValue;
}
 
   
public List<String> getInputList(){
   inputListtest;
}

 

Anand@SAASAnand@SAAS
Use or to display the same. For e.g.