Why do I get this error: value for apex:inputField is not a dynamic binding! ?
My return page is supposed to display details from both Order_Form__c and Order__c objects automatically upon searching a certain order form record from the lookup field on the Return__c object. But every time I hit the preview button, there comes the said error.
Here's my controller:
ReturnManagementCX
public with sharing class ReturnManagementCX {
private ApexPages.StandardController con;
public Return__c returnRecord {get;set;}
public Order_Form__c ordformqry {get;set;}
public List<resultWrapper> ordwrapperlist {get;set;}
public List<Return__c> return1 {get;set;}
public Return__c newReturn {get;set;}
public Order_Form__c orderformclone = new Order_Form__c();
public Boolean Page1 {get;set;}
public Boolean ShowTable {get;set;}
public Boolean ShowOrderForm {get;set;}
public ReturnManagementCX(ApexPages.StandardController controller) {
con = controller;
Page1 = true;
ShowTable = false;
ShowOrderForm = false;
ordwrapperlist = new List<resultWrapper>();
ordformqry = new Order_Form__c();
orderformclone = new Order_Form__c();
return1 = new List<Return__c>();
}
public void init() {
ShowTable = true;
List<Order__c> orders = new List<Order__c>();
List<resultWrapper> tempwrapper = new List<resultWrapper>();
if(returnRecord.Order_Form__c != null) {
ordformqry = [SELECT Id, Name, Account__c, Purchased_Date__c, Status__c FROM Order_Form__c WHERE Id =: returnRecord.Order_Form__c];
orderformclone = ordformqry.Clone(true,true,true,true);
}
if(returnRecord.Order_Form__c == null) {
ordwrapperlist.clear();
}
if(returnRecord.Order_Form__c != null) {
orders = [SELECT Id, Name, Product__c FROM Order__c WHERE Id =: returnRecord.Order_Form__c];
}
for(Order__c ordloop : orders) {
tempwrapper.add(new resultWrapper(ordloop));
}
if(tempwrapper != null) {
ordwrapperlist = tempwrapper;
}
}
public void proceed() {
List<Return__c> returnlist = new List<Return__c>();
Return__c newReturn = new Return__c();
Set<Id> newIds = new Set<Id>();
System.debug('ordformqry v orderformclone>>' + ordformqry +'>>'+orderformclone);
if(orderformclone.Account__c != ordformqry.Account__c || orderformclone.Purchased_Date__c != ordformqry.Purchased_Date__c || orderformclone.Status__c != ordformqry.Status__c) {
System.debug('before update ordformqry>>'+ordformqry);
update ordformqry;
System.debug('after update ordformqry>>'+ordformqry);
}
if(returnlist.size() > 0) {
insert newReturn;
Set<Id> ids = new Set<Id>();
for(Return__c idloop : returnlist) {
ids.add(idloop.id);
}
List<Return__c> retqry = [SELECT Id, Name, Order_Form__c, Order__c FROM Return__c WHERE Id IN : ids];
System.debug('retqry>>'+ retqry);
return1 = retqry;
}
}
public class resultWrapper {
public Order__c orderlist {get;set;}
public resultWrapper(Order__c ord) {
orderlist = ord;
}
}
}
And here's my vf page:
ReturnManagementPage
<apex:page standardController="Return__c" extensions="ReturnManagementCX">
<apex:form id="theForm" rendered="{!Page1}">
<apex:pageBlock id="block1">
<apex:pageBlockSection >
<apex:inputField >
<apex:actionSupport action="{!init}" event="onchange"/>
</apex:inputField>
</apex:pageBlockSection>
<apex:pageBlockSection id="orderforminfo" rendered="{!ShowOrderForm}">
<apex:inputField value="{!ordformqry.Account__c}"/>
<apex:inputField value="{!ordformqry.Purchased_Date__c}"/>
<apex:inputField value="{!ordformqry.Status__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock id="block2" rendered="{!ShowTable}">
<apex:pageBlockSection id="block2" title="Order Items">
<apex:pageBlockTable value="{!ordwrapperlist}" var="ol">
<apex:column headerValue="Product" value="{!ol.orderlist.Product__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
I'll appreciate any help, thanks.