You need to sign in to do that
Don't have an account?

Dynamic inputField type in Datatable
I need to construct table with input fields in following code
<apex:dataTable value="{!udas}" var="uda" cellPadding="4" border="1">
<apex:column >
<apex:facet name="header" >Name</apex:facet>
{!uda.udaName}
</apex:column>
<apex:column >
<apex:facet name="header" >Type</apex:facet>
{!uda.udaType}
</apex:column>
<apex:column >
<apex:facet name="header" >Value</apex:facet>
<apex:XXX value="{!uda.value}" />
</apex:column>
</apex:dataTable>
In above piece of code apex:XXX should be decided based on {!uda.udaType},
for Example
if it is boolean then field should be checkbox, if it is string then field should be inputText
Any ideas
here is how i do this
<apex:column >
<apex:selectRadio value="{!si.response.Response_Number__c}" rendered="{!si.question.Type__c == 'Radio'}">
<apex:selectOptions value="{!RadioItems}"/>
</apex:selectRadio>
<apex:inputField value="{!si.response.Response__c}" rendered="{!si.question.Type__c == 'String'}"/>
</apex:column>