1

I am trying to run a soql query based on an input value on a Visualforce Page. However, I don't see that the results are displayed on the page when the input field is changed.

VF Page:

<apex:page StandardController="Loan_Memo__c" Extensions="ReviewAccountCovenants" >
    <apex:form >
        <div>
            <apex:pageBlock id="thePageBlock" mode="edit" >
                <apex:pageBlockButtons location="top" >
                <apex:commandButton value="Update Covenants" action="{!updatecovs}" />
                </apex:pageBlockButtons>  
                 <apex:actionRegion>
                    <apex:pageBlockSection > 
                        <apex:inputField value="{!Loan_Memo__c.Relationship__c}" />
                            <apex:actionSupport event="onchange" action="{!getrelatedcovs}" reRender="covenanttable" status="status" />
                    </apex:pageBlockSection>   
                </apex:actionRegion  >
                <apex:actionStatus startText="applying value..." id="status" />
                    <apex:pageBlockTable    var="covenant"
                                            value="{!relatedcovs}"
                                            id="covenanttable"
                                            >
                         <apex:column headerValue="Covenant Type">
                            <apex:outputText value="{!covenant.LLC_BI__Covenant_Type__r.Name}"  rendered="{!Loan_Memo__c.Relationship__c != null}"/>
                         </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>
</apex:page>

2 Answers 2

4

You used a self closing input. You need to leave it open to nest the actionSupport under it.

Incorrect

<apex:inputField ... />
    <apex:actionSupport ... />

Correct

<apex:inputField ...>
    <apex:actionSupport ... />
</apex:inputField>
1

You need to include actionsupport inside your inputfield

<apex:inputField value="{!Loan_Memo__c.Relationship__c}" > 
  <apex:actionSupport event="onchange" action="{!getrelatedcovs}" reRender="covenanttable" status="status" /> 
</apex: inputfield>

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.