+ Start a Discussion
mworldmworld 

Dynamic Data Collection

I am creating a VF page to collect parameter values for report generation. Each report has 1 to n parameters that the user needs to input in order for the report to run correctly. I am using a DataTable to display these parameter inputs as text boxes. The page renders one row for each parameter. So far so good. The problem comes in retrieving the values in my Apex code. I have no way of differentitating one row from another. As best I can tell, the ID value for the outputText box (ie textBox:0, textBox:1, textBox:2 etc) is not accesible to me within my Apex page controller.

Do I have to switch to using client-side (ie JavaScript) code for this?


Code: VF Page Snippet
<apex:dataTable value="{!Parameters}" var="parms">
    <apex:column width="40%"><apex:outputText id="textBox" value="{!parms.Parameter_Label__c}:"/></apex:column>
    <apex:column width="20%">&nbsp;</apex:column>
    <apex:column width="40%">
        <apex:inputText id="inputText" value="{!textValue}"/>
    </apex:column>
</apex:dataTable>

 Thanks!

Richie DRichie D
can you replace {!textValue} with {!parms.Value__c} then the value of the param will be set directly. All you need to do is update the collection returned in getParameters...