0

VF Page code:

<script>
   $(document).ready(function() {
    //showing spinner here
    callAsyncProcess();

    function fireOnComplete(){
        //stopping spinner here
    }
   });
</script>
<apex:form>
   <apex:actionFunction name="callAsyncProcess" reRender="tabPanelRerender" action="{!callApexCon}" onComplete="fireOnComplete()"></apex:actionFunction>
   <div class="slds-card__header slds-grid">
      <div class="slds-tabs--scoped">
         <div class="panel-group collapsible-group card" data-chevron-down="glyphicon-chevron-down"
            data-chevron-up="glyphicon-chevron-up">
            <div class="panel panel-default">
               <apex:outputPanel id="tabPanelRerender">
                  <div id="collapse1" class="panel-collapse collapse in">
                     <div role="tabpanel" class="slds-tabs--scoped__content slds-show" id="vertical-tab1">
                        <div role="tabpanel" class="tab-pane fade in active" id="vertical-tab3">
                           <div class="panel-body">
                              <apex:dataTable value="{!listData}" var="rc"
                                 id="idasd"
                                 rowClasses="odd, even">
                                 <apex:column value="{!rc.test1}"
                                    headerValue="#####"/>
                                 <apex:column value="{!rc.test1}"
                                    headerValue="#####"/>
                                 <apex:column value="{!rc.test1}"
                                    headerValue="#####"/>
                                 <apex:column headerValue="#####">
                                    <div data-content="{!rc.test1.test1}"
                                       data-trigger="hover"
                                       data-toggle="popover">{!rc.test1.test1}</div>
                                 </apex:column>
                                 <apex:column value="{!rc.test1}"
                                    headerValue="#####"/>
                                 <apex:column value="{!rc.test1}"
                                    headerValue="#####"/>
                                 <apex:column value="{!rc.test1}"
                                    headerValue="#####"/>
                              </apex:dataTable>
                           </div>
                        </div>
                     </div>
                  </div>
            </div>
         </div>
      </div>
      </apex:outputPanel>
   </div>
   </div>
   </div>
   </div>
</apex:form>

Apex Class:

public List<TestData> listData{ get; set; }


public Continuation callApexCon() {
    HttpRequest ht= new HttpRequest();
    ht.setEndpoint('https://jsonplaceholder.typicode.com/photos');
    ht.setMethod('GET');
    Continuation con= new Continuation(120);
    con.state = con.addHttpRequest(ht);
    con.continuationMethod = 'continuationCallback';
    system.debug('con-->' + con);
    return con;
}

public Object continuationCallback(Object sts) {
    HttpResponse httpResponse = Continuation.getResponse((String) sts);

    System.debug('goal-->' + httpResponse.getBody());
    listData.add(Some dummy data);
    return null;
}

Now when the page is opened the callAsyncProcess method gets invoked which internally invokes action function callApexCon. Which invokes the continuation:

But on the VF page I receive a message :

Unknown method 'ClassNameofTheController.continuationCallback()'
Error is in expression '{!continuationCallback}' in page PageNameofVFPage

Is there something I am missing here?

Your Answer

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

Browse other questions tagged or ask your own question.