I'm getting below error when I used <apex:inputfield>
instead of <apex:inputtext>
,
apex:inputfield can only be used with sobjects or objects that are visualforce field component
But my requirement is to have inputfield
so that a lookup to the user will be generated based on the lookup relationship given to the field.
VF Page
<apex:pageblockTable value="{!items}" var="item" columns="6" id="thetable">
<apex:column headerValue="Internal Receipient">
<apex:inputText value="{!item.internalrec}"/><!-- **This should be Input field (Lookup Field)>Make field Required** -->
</apex:column>
</apex:pageblockTable>
Controller Class
public class BonusSplitclass {
public list<Fields_List> items;
public void setitems(list<Fields_List> fielditem){
items = fielditem;
}
public list<Fields_List> getitems(){
if(items.isempty()){
items = new list<Fields_list>();
}
return items;
}
public BonusSplitclass(ApexPages.StandardController controller) {
string id = Apexpages.currentpage().getparameters().get('id');
items = new list<Fields_List>();
for(integer i=0; i<5 ;i++){
Fields_List fl = new Fields_List();
bonus_split__c bs = new bonus_split__c();
fl.internalrec = bs.Internal_Recipient__c;
items.add(fl);
}
Public class Fields_list{
public string internalrec{get;set;}
}
}