//VF Page
<apex:page controller="RetrieveClasses">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!wrapList}" var="a" style="border-width:thin;border-style:solid;width:100%;border-color:gray;">
<apex:column >
<apex:inputCheckbox value="{!a.ischeck}"/>
</apex:column>
<apex:column value="{!a.ac.name}" headerValue="Apex Classes"/>
<apex:column value="{!a.ac.createdby.name}" headerValue="Created By" />
<apex:column value="{!a.ac.createdDate}" headerValue="Created Date" />
</apex:pageblockTable>
<!-- <apex:pageBlockTable value="{!pageList}" var="b" style="border-width:thin;border-style:solid;width:100%;border-color:gray;">
<apex:column >
<apex:inputCheckbox value="{!isCheck}"/>
</apex:column>
<apex:column value="{!b.name}" headerValue="Apex Pages"/>
<apex:column value="{!b.createdby.name}" headerValue="Created By" />
<apex:column value="{!b.createdDate}" headerValue="Created Date" />
</apex:pageblockTable> -->
</apex:pageBlock>
</apex:form>
</apex:page>
//Controller
public class RetrieveClasses{
public List <wrapClassPages> wrapList {get;set;}
public RetrieveClasses()
{
wrapList = new List<wrapClassPages>();
for(ApexClass a : [SELECT id, name,createdby.name,createdDate from ApexClass])
{
wrapList.add(new wrapClassPages(a, false));
}
System.debug('>>>>>WrapList>>>>>>>>>>' +wrapList);
/*
for(ApexPage p: [Select id, name, createdby.name, createdDate from ApexPages])
{
wrapList.add(new wrapClassPages(p, false));
}
*/
}
public class wrapClassPages
{
public ApexClass ac{get;set;}
//public ApexPage ap{get;set;}
public Boolean ischeck {get;set;}
public wrapClassPages(ApexClass ac,Boolean v)
{
this.ac = ac;
//this.ap = ap;
ischeck = v;
}
}
}
I'm trying to write a wrapper class to display Apex classes and VF pages from my org.
I'm done with half part, adding apex classes, but I'm unable to add VF pages with same approach.