1

I am receiving an error when trying to rerender a covenant table:

Unknown property 'Loan_Memo__cStandardController.covenanttable'

How to I load my table based on the value of the inputField?

VF:

<apex:form >
    <div>
        <apex:pageBlock >
            <apex:pageBlockButtons location="top" >
            <apex:commandButton value="Update Covenants" action="{!keep}" />
            </apex:pageBlockButtons>  
            <apex:pageBlockSection > 
                <apex:inputField value="{!mymemo.Relationship__c}" />
                    <apex:actionSupport event="onchange" action="{!getrelatedcovs}" reRender="{!covenanttable}"  />
            </apex:pageBlockSection>                                          
            <apex:pageBlockTable var="covenant" value="{!relatedcovs}" id="covenanttable" >
                <apex:column headerValue="Covenant Type">
                    <apex:outputText value="{!covenant.LLC_BI__Covenant_Type__r.Name}" />
                </apex:column>
                <apex:column headerValue="Requirement">
                    <apex:inputField value="{!covenant.Requirement__c}" />
                </apex:column>      
                <apex:column headerValue="Actual">
                    <apex:inputField value="{!covenant.Actual__c}" />
                </apex:column>

            </apex:pageBlockTable>

        </apex:pageBlock>
    </div>
</apex:form>

Controller Extension: public class ReviewAccountCovenants {

public String currentRecordID                   {get;set;} 
public  LLC_BI__Loan__c myLoan                  {get;set;}
public list<LLC_BI__Covenant2__c> relatedcovs   {get;set;}
public Loan_Memo__c mymemo                      {get;set;}              

public ReviewAccountCovenants(ApexPages.StandardSetController stdController{
this.myMemo = (Loan_Memo__c)stdController.getRecord();
this.relatedcovs = new list<LLC_BI__Covenant2__c>();
 if(mymemo.Relationship__c !=null) getrelatedcovs();}

public void getrelatedcovs(){  
        relatedcovs =  [
    SELECT Id, Requirement__c, Actual__c, LLC_BI__Covenant_Type__r.Name, Name 
    FROM LLC_BI__Covenant2__c
    WHERE Id in (
            SELECT LLC_BI__Covenant2__c
            FROM LLC_BI__Account_Covenant__c
            WHERE LLC_BI__Account__c  =: mymemo.Relationship__c)];   
            system.debug(relatedcovs);  }}
2

Don't use a merge field for your rerender attribute. Just use a literal value.

Incorrect:

reRender="{!covenanttable}"

Correct:

reRender="covenanttable"

When you use a merge field, the markup then looks for a property by that name, which is not defined. Note the description of the rerender attribute from the documentation on <apex:actionSupport>:

The ID of one or more components that are redrawn when the result of an AJAX update request returns to the client. This value can be a single ID, a comma-separated list of IDs, or a merge field expression for a list or collection of IDs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.