Can you please me to identify what is wrong in the below code :
VF page :
<apex:page standardController="Case" extensions="relevant">
<apex:form>
<apex:pageBlock id="block" mode="edit">
<apex:pageMessages />
<apex:pageBlockSection title="Recommended Resolution" id="cases" columns="1">
<apex:pageBlockTable value="{!consolewrapperlist}" var="acc" width="100%">
<apex:column headerValue="Select">
<input type="radio" name="<strong>selectRadio</strong>" id="radio">
<br/>
<apex:actionSupport event="onclick" action="{!getSelected}" status="buttonStatus" reRender="cntblock">
<apex:param name="accid" value="{!acc.id}" />
</apex:actionSupport>
</input>
</apex:column>
<apex:column>
<apex:commandLink value="{!acc.Name}" /> </apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public with sharing class relevant {
public List<consolewrap> ConsoleWrapperList{get;set;}
public string selectedAccountId{get; set;}
public relevant(ApexPages.StandardController controller) {
getperformcallout();
}
public List<consolewrap> getperformcallout(){
ConsoleWrapperList = new List<consolewrap>();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('https://raw.githubusercontent.com/parthiban019/samplejson/master/student.json');
req.setMethod('GET');
system.debug('req '+req);
res = http.send(req);
system.debug('res'+res);
system.debug('resbody'+res.getbody());
if(res.getstatusCode() == 200 && res.getbody() != null){
ConsoleWrapperList=(List<consolewrap>)json.deserialize(res.getbody(),List<consolewrap>.class);
}
return consolewrapperlist;
}
public PageReference getSelected()
{
System.debug('Entered account selection block');
selectedAccountId = ApexPages.currentPage().getParameters().get('accid');
system.debug(selectedAccountId );
return null;
}
}
ConsoleWrap :
public class consolewrap {
public String Name{get;set;}
public String AccNumber{get;set;}
public String Source{get;set;}
public String Site{get;set;}
public String Email{get;set;}
}
consolewrap.id
is not being used in the page you pasted. Is it the correct one? – Raul Aug 29 '17 at 11:20