For my current scenario I am populating a table with a list of Suppliers(Col1) and Count of Records(Col2) Assigned to them. For this I have used an aggregateresult and have created a new class Summary and have updated the table.
The problem now is I need to have another column in the table - that is editable - to enter the max no of records that could be assigned to him. For the editable column I tried to assign apex:InputField, but that doesnt work. I am getting an error "Could not resolve entity form apex:inputField value binding.
<apex:page controller="Sample" sidebar="false" action="{!show}">
<apex:pagemessages />
<apex:form >
<apex:pageBlock >
<apex:pageblockTable value="{!SummaryList}" var="r">
<apex:column headerValue="Supplier Name" value="{!r.SupplierName}"/>
<apex:column headerValue="Number of Contacts" value="{!r.Total}"/>
<apex:column headerValue="Percentage">
<apex:inputField value="{!r.percentage}"/>>
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
The class in Apex Controller where the percentage field is initialized...
public class Summary {
public Integer Total {get;set;}
public String SupplierName{get;set;}
public String Percentage{get;set;}
public Summary(AggregateResult a, String Name) {
Total = (Integer)a.get('Total');
SupplierName= Name;
}
}