<table>
<th>Select</th>
<th>Field Name</th>
<th>Standard API Name</th>
<apex:repeat value="{!allFields}" var="fieldBean" id="theRepeat">
<tr>
<td><input name="CheckBoxName" id="checkBoxID" type="checkbox" value="{!fieldBean.fieldAPIName }" /></td>
<td><input id="fieldName{!fieldBean.fieldAPIName }" type="text" value="{!SUBSTITUTE(fieldBean.fieldAPIName ,'Empyramdm__','')}" disabled="true" /></td>
<!-- <td> <apex:outputPanel id="myFields">
<apex:actionRegion >
<apex:selectList value="{!selectedField}" size="1" >
<apex:selectOptions value="{!ObjectFields}"/>
</apex:selectList>
</apex:actionRegion>
</apex:outputPanel>
</td>-->
<td>
<select id="selectedField{!selectedField}">
<option form="{!ObjectFields}">{!ObjectFields}</option>
</select>
</td>
</tr>
</apex:repeat>
</table>
public List < String > getObjectFields() {
Map < String, Schema.SObjectType > schemaMap = Schema.getGlobalDescribe();
Schema.SObjectType ObjectSchema = schemaMap.get('Account');
Map < String, Schema.SObjectField > fieldMap = ObjectSchema.getDescribe().fields.getMap();
List < SelectOption > fieldNames = new List < SelectOption > ();
fieldNames.add(new SelectOption('--None--', '--None--'));
Schema.SObjectField field;
for (String fieldName: fieldMap.keySet()) {
field = fieldMap.get(fieldName);
//field = fieldMap.get(fieldName);
Schema.DescribeFieldResult Fig = field.getDescribe();
Boolean iscreate = Fig.isCreateable();
if (iscreate == true)
fieldNames.add(new SelectOption(fieldName, fieldName));
//fieldMap.get(fieldName).getDescribe().getLabel();//It provides to get the object fields label.
fieldslisy.add(fieldName);
}
return fieldslisy;
}
i had created a html table,in vf page,instead of showing in dropdown,it is showing in String.i want to display entire in in dropdown by spilittingcomma, thanks in advance.
iam mapping the fields of Custom object to Standard object field,if i submit button,i have to save the custom Object associated with Standard Object Field. I had created one custom object to save this maaping,Field1 is CustomField,Field2 is StandardField.on click of Submit button iam not getting Standard object field,how can i read the data in controller.thanks,need help.