i.e if I am selecting field status Value should show picklists available in status field as picklist
Visualforce :
<apex:pageBlockSection title="Rule Criteria">
<apex:pageBlockTable value="{!wrappers}" var="wrapper" id="wtable">
<apex:column headerValue="Ident">
<apex:outputText value="{!wrapper.ident}"/>
</apex:column>
<apex:column headerValue="Field">
<apex:selectList value="{!wrapper.acc.WFCField__c}" size="1">
<apex:selectOptions value="{!FieldSeletOptions}"/>
</apex:selectList>
</apex:column>
<apex:column headerValue="Operator">
<apex:inputField value="{!wrapper.acc.WFC_Operator__c}"/>
</apex:column>
<apex:column headerValue="Value">
<apex:inputField value="{!wrapper.acc.WFCField__c}"/>
</apex:column>
<!-- <apex:column headerValue="Action">
<apex:commandButton value="Delete" action="{!delWrapper}" rerender="wtable">
<apex:param name="toDelIdent" value="{!wrapper.ident}" assignTo="{!toDelIdent}"/>
</apex:commandButton>
</apex:column>-->
</apex:pageBlockTable>
</apex:pageBlockSection>
Code in controller get SelectOpions for field column:
public List<SelectOption> getFieldSeletOptions()
{
List<SelectOption> fieldOptions = new List<SelectOption>();
String type='Case';
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType caseSchema = schemaMap.get(type);
Map<String, Schema.SObjectField> fieldMap = caseSchema.getDescribe().fields.getMap();
SelectOption optionNone = new SelectOption('', '--None--');
fieldOptions.add(optionNone);
for (String fieldName: fieldMap.keySet()) {
System.debug('##Field API Name='+fieldName);// list of all field API name
//It provides to get the object fields label.
Schema.DisplayType fieldType = fieldMap.get(fieldName).getDescribe().getType();
if(fieldType != Schema.DisplayType.ID)
{
SelectOption option = new SelectOption(fieldName, fieldMap.get(fieldName).getDescribe().getLabel());
fieldOptions.add(option);
}
}
return fieldOptions;
}
Wrapper
public class WFCriteriaWrapper
{
public WFCriteria__c acc {get; private set;}
public Integer ident {get; private set;}
public WFCriteriaWrapper(Integer inIdent)
{
ident=inIdent;
acc=new WFCriteria__c();
}
}