I have a VF page that has pageblock table on it which displays data from a list. I am trying to add a field from that list as a input field but I get the below error for the quantity field. How can I use a field from a list of non sObject as input field ?
<apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.
Code : Controller
public class TestController_NWL{
public class OrderProduct{
public String materialNumber {get; set;}
public Integer quantity {get; set;}
}
Public List<OrderProduct> orderProductsList {get; set;}
}
VF Page :
<apex:page controller="TestController_NWL">
<apex:pageBlockSection title="Products" columns="1">
<apex:pageBlockTable value="{!orderProductsList}" var="op" title="Products">
<apex:column headerValue="Material Number">
<apex:outputLink onclick="alert('Success');">
{!HTMLENCODE(op.materialNumber)}
</apex:outputLink>
</apex:column>
<apex:column headerValue="Material Number">
<apex:inputField value="{!op.quantity}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>