function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aKallNVaKallNV 

Wrapper Class in Sub-Query?

I have created a VF page that allows a user to associate a record(SchoolWorkPlanLog__c)  with mulitple records via checkboxes by using a wrapper class. It's my first time using a wrapper class, and don't fully understand it...I found a great blog post about them with some sample code. I have everything working great, but there is one thing I can't figure out that would make the page way more functional. The records that the SchoolWorkPlanLog__c record could potentially be tied to have a parent record of their own. So, rather than just show the names of the records that the SchoolWorkPlanLog__c record could be tied to, I would like to group them by the names of their parent records in the table. So my thought was to query the parent record and pull in the child records with a sub-query, but this is complicating things with my wrapper class. So I have posted two versions of the code. The first version is the one that works, and the second is the one that I'm getting lost with.

 

Works:

 

 

public with sharing class narrativeWizard_Controller {
        
	 public String swpnAccount { get; set; }
        public SchoolWorkPlanLog__c getLog { get; set; }
        public List<ActionItemLogx__c> juncObs { get; set; }
        public List<cAIS> actionItems { get; set; }     
        
        
        public List<cAIS> getAIs() {
                if(actionItems == null) {
                    actionItems = new List<cAIS>();
                    for(DeployedActionItems__c ds : [select ID, Name, Status__c, DeployedStrategy__r.Strategy__r.Name, EndDate__c from DeployedActionItems__c where DeployedStrategy__r.Account__c = :ApexPages.currentPage().getParameters().get('aID') And Status__c = 'Active']) {
                            actionItems.add(new cAIS(ds));
                    }
                }
                return actionItems;      
        }
        
        public PageReference processSelected() {  
        	//insert new Log
        	SchoolWorkPlanLog__c newLog = new SchoolWorkPlanLog__c(
        	Account__c = ApexPages.currentPage().getParameters().get('aID'),
        	Subject__c = this.getLog.Subject__c,
        	Narrative__c = this.getLog.Narrative__c,
        	InteractionDate__c = this.getLog.InteractionDate__c);
        	
        	insert newLog;
        	
        	//insert new Junction Records              
            List<DeployedActionItems__c> selectedAIs = new List<DeployedActionItems__c>();
            List<ActionItemLogx__c> newJuncObjs = new List<ActionItemLogx__c>();
               
            for(cAIS cAI : getAIs()) {
                if(cAI.selected == true) {
                	selectedAIs.add(cAI.wAI);
                }
            }
            
            for(DeployedActionItems__c ds2 : selectedAIs) {
            	ActionItemLogx__c newJuncOb = new ActionItemLogx__c(
            	SchoolWorkPlanLog__c = newLog.Id,
            	ActionItem__c = ds2.Id);
            	
            	newJuncObjs.add(newJuncOb);
            }
            insert newJuncObjs;
            
            PageReference acctPage = new PageReference('/'+ApexPages.currentPage().getParameters().get('aID'));
                        
            return acctPage;
        }
        
        
        //sets up class extension of SchoolWorkPlanLog__c
        private final SchoolWorkPlanLog__c swpn;
                
        public narrativeWizard_Controller(ApexPages.StandardController swpnController) {
                this.swpn = (SchoolWorkPlanLog__c)swpnController.getRecord();
                this.setUpAccount();  
                this.getAIs(); 
                this.getLog= new SchoolWorkPlanLog__c();         
        }
        
        public void setUpAccount() {
                Account acct = [select ID, Name from Account where ID = :ApexPages.currentPage().getParameters().get('aID') Limit 1];
                this.swpnAccount = acct.Name;
        }
        
                        
        //wrapper class
        public class cAIS {
                public DeployedActionItems__c wAI { get; set; }
                public Boolean selected { get; set; }           
                
                //wrapper class constructor
                public cAIS(DeployedActionItems__c c) {
                        wAI = c;
                        selected = false;
                }
        }       
}

 

<apex:page sidebar="false" showHeader="true" standardController="SchoolWorkPlanLog__c" extensions="narrativeWizard_Controller">
    <apex:form >
      <apex:pageBlock mode="edit" >  
      <apex:pageBlockButtons >
          <apex:commandButton action="{!processSelected}" value="Save"/>
      </apex:pageBlockButtons>  
      <apex:pageBlockSection title="{!swpnAccount}" >
              <apex:inputField value="{!getLog.Subject__c}"/>
              <apex:inputField value="{!getLog.InteractionDate__c}"/>
          <apex:pageblockSectionItem >
              <apex:inputField value="{!getLog.Narrative__c}"/>
          </apex:pageblockSectionItem>
      </apex:pageBlockSection>     
      <apex:pageBlockSection >
          <apex:PageBlockTable value="{!actionItems}" var="c">
              <apex:column >
                  <apex:inputCheckbox value="{!c.selected}"/>
              </apex:column>
              <apex:column headerValue="Name">
                  {!c.wAI.Name__c}
              </apex:column>
              <apex:column headerValue="Status">
                  {!c.wAI.Status__c}
              </apex:column>
              <apex:column headerValue="End Date" width="125">                
                   <apex:outputText value="{0,date,MM-dd-yyyy}">
                   <apex:param value="{!c.wAI.EndDate__c}"/>
                   </apex:outputText>
              </apex:column>
          </apex:PageBlockTable>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>   
</apex:page>

 Doesn't work:

 

public with sharing class narrativeWizard_Controller {
        
	 public String swpnAccount { get; set; }
        public SchoolWorkPlanLog__c getLog { get; set; }
        public List<ActionItemLogx__c> juncObs { get; set; }
        public List<cAIS> actionItems { get; set; }     
        
        
        public List<cAIS> getAIs() {
                if(actionItems == null) {
                    actionItems = new List<cAIS>();
                    for(DeployedStrategy__c ds : [select ID, Account__r.Name, Name, Status__c, EndDate__c, (select ID, Name, Status__c, EndDate__c from DeployedActionItem__r) from DeployedStrategy__c where Account__c = :ApexPages.currentPage().getParameters().get('aID') And Status__c = 'Active']) {
                    	for(DeployedActionItems__c dAI : ds.DeployedActionItem__r) {
                    		actionItems.add(new cAIS(dAI));
                    	}
                    }
                }
                return actionItems;      
        }
        
        public PageReference processSelected() {  
        	//insert new Log
        	SchoolWorkPlanLog__c newLog = new SchoolWorkPlanLog__c(
        	Account__c = ApexPages.currentPage().getParameters().get('aID'),
        	Subject__c = this.getLog.Subject__c,
        	Narrative__c = this.getLog.Narrative__c,
        	InteractionDate__c = this.getLog.InteractionDate__c);
        	
        	insert newLog;
        	
        	//insert new Junction Records              
            List<DeployedActionItems__c> selectedAIs = new List<DeployedActionItems__c>();
            List<ActionItemLogx__c> newJuncObjs = new List<ActionItemLogx__c>();
               
            for(cAIS cAI : getAIs()) {
                if(cAI.selected == true) {
                	selectedAIs.add(cAI.wAI);
                }
            }
            
            for(DeployedActionItems__c ds2 : selectedAIs) {
            	ActionItemLogx__c newJuncOb = new ActionItemLogx__c(
            	SchoolWorkPlanLog__c = newLog.Id,
            	ActionItem__c = ds2.Id);
            	
            	newJuncObjs.add(newJuncOb);
            }
            insert newJuncObjs;
            
            PageReference acctPage = new PageReference('/'+ApexPages.currentPage().getParameters().get('aID'));
                        
            return acctPage;
        }
        
        
        //sets up class extension of SchoolWorkPlanLog__c
        private final SchoolWorkPlanLog__c swpn;
                
        public narrativeWizard_Controller(ApexPages.StandardController swpnController) {
                this.swpn = (SchoolWorkPlanLog__c)swpnController.getRecord();
                this.setUpAccount();  
                this.getAIs(); 
                this.getLog= new SchoolWorkPlanLog__c();         
        }
        
        public void setUpAccount() {
                Account acct = [select ID, Name from Account where ID = :ApexPages.currentPage().getParameters().get('aID') Limit 1];
                this.swpnAccount = acct.Name;
        }
        
                        
        //wrapper class
        public class cAIS {
                public DeployedActionItems__c wAI { get; set; }
                public Boolean selected { get; set; }           
                
                //wrapper class constructor
                public cAIS(DeployedActionItems__c c) {
                        wAI = c;
                        selected = false;
                }
        }       
}

 

<apex:page sidebar="false" showHeader="true" standardController="SchoolWorkPlanLog__c" extensions="narrativeWizard_Controller">
    <apex:form >
      <apex:pageBlock mode="edit" >  
      <apex:pageBlockButtons >
          <apex:commandButton action="{!processSelected}" value="Save"/>
      </apex:pageBlockButtons>  
      <apex:pageBlockSection title="{!swpnAccount}" >
              <apex:inputField value="{!getLog.Subject__c}"/>
              <apex:inputField value="{!getLog.InteractionDate__c}"/>
          <apex:pageblockSectionItem >
              <apex:inputField value="{!getLog.Narrative__c}"/>
          </apex:pageblockSectionItem>
      </apex:pageBlockSection>     
      <apex:pageBlockSection >
          <apex:PageBlockTable value="{!AIs}" var="c">
              <apex:column headerClass="School" value="{!c.Account__r.Name}"/>
              <apex:column headerValue="Strategy" value="{!c.Name}"/>
                  <apex:column breakBefore="true" colspan="3">        
                      <apex:outputPanel>
                          <apex:dataTable value="{!actionItems}" var="s">
                               <apex:column >
                  <apex:inputCheckbox value="{!s.selected}"/>
              </apex:column>
              <apex:column headerValue="Name">
                  {!s.wAI.Name__c}
              </apex:column>
              <apex:column headerValue="Status">
                  {!s.wAI.Status__c}
              </apex:column>
              <apex:column headerValue="End Date" width="125">                
                   <apex:outputText value="{0,date,MM-dd-yyyy}">
                   <apex:param value="{!s.wAI.EndDate__c}"/>
                   </apex:outputText>
              </apex:column>
                          </apex:dataTable>
                      </apex:outputPanel>
                  </apex:column>    
              <apex:column >
                  <apex:inputCheckbox value="{!c.selected}"/>
              </apex:column>
              <apex:column headerValue="Name">
                  {!c.wAI.Name__c}
              </apex:column>
              <apex:column headerValue="Status">
                  {!c.wAI.Status__c}
              </apex:column>
              <apex:column headerValue="End Date" width="125">                
                   <apex:outputText value="{0,date,MM-dd-yyyy}">
                   <apex:param value="{!c.wAI.EndDate__c}"/>
                   </apex:outputText>
              </apex:column>
          </apex:PageBlockTable>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>   
</apex:page>

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

Do these in your apex class

 

1)Create a list of parent records List<Praent__C> listParent = new List<Parent__c>(); , add items in list

2)Create a map which has the parentId as Key and List of child rcords as Values

 Map<ID, List<ChildRecods__c> > mapParentID_ListChilds = new Map<ID, List<ChildRecods__c>>();

here List<ChildRecods__c> should only be the child of that parent only ot all childs

add items in this map

 

3) In VFP

   <apex:pageBlockTable value="{!listParent}" var="parent" >

           //Add columns aas per your req

           <apex:pageBlockTable value="{!mapParentID_ListChilds[parent.id]}" var="child"/>

  </apex:parent>

 

All Answers

Shashikant SharmaShashikant Sharma

Hi,

 

Change your wrapper like this

 

//wrapper class
        public class cAIS {
                public DeployedActionItems__c wAI { get; set; }
                public Boolean selected { get; set; }           
                public String deploymentStrategyName {get;set;}
                //wrapper class constructor
                public cAIS(DeployedActionItems__c c , String deploymentStrategyName) {
                        wAI = c;
                        selected = false;
this.
<apex:column headerValue="DeploymentStrategyName ">
                  {!s.deploymentStrategyName }
              </apex:column>

 

= deploymentStrategyName; } }

 

 

then where you add items to list of wrapper do this

actionItems.add(new cAIS(dAI) , ds.Name);

 

 

Add a column in your VFP

<apex:column headerValue="DeploymentStrategyName">
                  {!s.deploymentStrategyName }
              </apex:column>

 

 

Above three steps will work for you. For more parent fields , You can add complete parent deployementstrtegey object in wrapper if you want other fields of parent to be shown there.

 

 

Shashikant SharmaShashikant Sharma

Sorry for first step it did not get posted correctly it is

 

 

//wrapper class
        public class cAIS {
                public DeployedActionItems__c wAI { get; set; }
                public Boolean selected { get; set; }           
                public String deploymentStrategyName {get;set;}
                //wrapper class constructor
                public cAIS(DeployedActionItems__c c , String deploymentStrategyName) {
                        wAI = c;
                        selected = false;
this.deploymentStrategyName = deploymentStrategyName ;
}

 

 

aKallNVaKallNV

Thanks, your posts have helped but I still haven't solved the problem. What I wan't to do is create a VF table that groups my wrapper class values by their parent records. Your solution pulls in the parent values but only adds them as another column which simply repeats the parent value for each subquery result. The VF page below is much closer to what I am trying to do. You will see i have a dataTable nested inside of a pageBlockTable. The datatable contains the checkbox and values from the soql subquery, and pageblocktable contains the parent records. 

 

 

<apex:page sidebar="false" showHeader="true" standardController="SchoolWorkPlanLog__c" extensions="narrativeWizard_Controller">
    <apex:form >
      <apex:pageBlock mode="edit" >  
      <apex:pageBlockButtons >
          <apex:commandButton action="{!processSelected}" value="Save"/>
      </apex:pageBlockButtons>  
      <apex:pageBlockSection title="{!swpnAccount}" >
              <apex:inputField value="{!getLog.Subject__c}"/>
              <apex:inputField value="{!getLog.InteractionDate__c}"/>
          <apex:pageblockSectionItem >
              <apex:inputField value="{!getLog.Narrative__c}"/>
          </apex:pageblockSectionItem>
      </apex:pageBlockSection>     
      <apex:pageBlockSection >
          <apex:PageBlockTable value="{!actionItems}" var="c" columns="3">
              <apex:column value="{!c.wDS.Strategy__r.Name}" headerValue="Strategy Name"/>
              <apex:column value="{!c.wDS.Stage__c}" headerClass="Stage"/>
              <apex:column headervalue="End Date">
                  <apex:outputText value="{0,date,MM-dd-yyyy}">
                   <apex:param value="{!c.wAI.EndDate__c}"/>
                   </apex:outputText>
              </apex:column>
              <apex:column colspan="3">
                  <apex:outputPanel id="subtable">
                      <apex:dataTable value="{!c.wDS.DeployedActionItem__r}" var="d">                          
                          <apex:column headerValue="Name">
                              {!d.Name__c}
                          </apex:column>
                          <apex:column headerValue="Status">
                              {!d.Status__c}
                          </apex:column>
                          <apex:column headerValue="End Date" width="125">                
                               <apex:outputText value="{0,date,MM-dd-yyyy}">
                                   <apex:param value="{!d.EndDate__c}"/>
                               </apex:outputText>
                          </apex:column>
                      </apex:dataTable>
                  </apex:outputPanel>
              </apex:column>                      
          </apex:PageBlockTable>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>   
</apex:page>

 

 

Shashikant SharmaShashikant Sharma

If you want to have all child of a parent in sequence that you can achive by sorting the items. But in this case parent's name will come with every time. If you want to have a vfp in which you want parent item name once and all cjild items associtated with it then use Repeat in table, your table should loop over Parent and Repaet willl loop over childs. You will have to use map for this.

aKallNVaKallNV

So close yet so far away!

 

I now have a table that groups children by their parents and has a check box next to the children to allow for extra logic. I haved used a map as you suggested. However, I took a different approach with VF page becasue I don't understand <apex:repeat> tag. I have tried to do this by nesting <apex:dataTable> tags. 

 

The problem is that the sub-tables are displaying child records from both parents under each parent.  So, if there were 2 Parent records each Parent in the table would have 2 subtables...one subtable consisting of the correct child records, and a second subtable consisting of the other parent's child records.

 

So, I'm going to post my most recent code...hopefully for the last time.

 

Thanks!

 

 

public with sharing class narrativeWizard_Controller {
        
	 	public String accountID;
	 	public String swpnAccount { get; set; }
        public SchoolWorkPlanLog__c getLog { get; set; }
        public List<ActionItemLogx__c> juncObs { get; set; }
        //public List<cAIS> actionItems { get; set; }  
        public List<cDS> theWrappers { get; set; }   
        
        
       	//populates the two wrapper classes defined below
        public List<cDS> getTheWrappers() {
                if(theWrappers == null) {
                	
                	theWrappers = new List<cDS>();
                    Map<Id,List<cAIS>> actionItems = new Map<Id, List<cAIS>>();
                    List<ID> theIDs = new List<ID>();
                    
                    for(DeployedStrategy__c ds : [select ID, Name, Status__c, Strategy__r.Name, EndDate__c, (select ID, Name, Name__c, Status__c, DeployedStrategy__r.Strategy__r.Name, EndDate__c from DeployedActionItem__r) from DeployedStrategy__c where DeployedStrategy__c.Account__c = :accountID And Status__c = 'Active']) {
                    	theIDs.add(ds.Id);
                    	for(DeployedActionItems__c actI : ds.DeployedActionItem__r) {
                    		List<cAIS> cAIS1 = actionItems.get(ds.Id);
                    		if(null == cAIS1) {
                    			cAIS1 = new List<cAIS>();
                    			actionItems.put(ds.Id, cAIS1);
                    		}
                    		cAIS1.add(new cAIS(actI));
                    	}                  	
                    	theWrappers.add(new cDS(ds, actionItems, theIDs));                    	
                    }
                }
                return theWrappers;      
        }
        
        public PageReference processSelected() {  
        	//insert new Log
        	SchoolWorkPlanLog__c newLog = new SchoolWorkPlanLog__c(
        	Account__c = accountID,
        	Subject__c = this.getLog.Subject__c,
        	Narrative__c = this.getLog.Narrative__c,
        	InteractionDate__c = this.getLog.InteractionDate__c);
        	
        	insert newLog;
        	
        	//insert new Junction Records              
            List<DeployedActionItems__c> selectedAIs = new List<DeployedActionItems__c>();
            List<ActionItemLogx__c> newJuncObjs = new List<ActionItemLogx__c>();
               
            for(cDS cd : getTheWrappers()) {
                for(cAIS ca : cd.ais.get(cd.wDS.Id)) {
                	if(ca.selected == true) {
                		selectedAIs.add(ca.wAI);
                		
                	}                	
                }
            }
            
            for(DeployedActionItems__c ds2 : selectedAIs) {
            	ActionItemLogx__c newJuncOb = new ActionItemLogx__c(
            	SchoolWorkPlanLog__c = newLog.Id,
            	ActionItem__c = ds2.Id);
            	
            	newJuncObjs.add(newJuncOb);
            }
            insert newJuncObjs;
            
            PageReference acctPage = new PageReference('/'+accountID);
                        
            return acctPage;
        }
        
        
        //sets up class extension of SchoolWorkPlanLog__c
        private final SchoolWorkPlanLog__c swpn;
                
        //CONSTRUCTOR
        public narrativeWizard_Controller(ApexPages.StandardController swpnController) {
                this.accountID = ApexPages.currentPage().getParameters().get('aID');
                this.swpn = (SchoolWorkPlanLog__c)swpnController.getRecord();
                this.setUpAccount();  
                this.getTheWrappers(); 
                this.getLog= new SchoolWorkPlanLog__c();         
        }
        
        public void setUpAccount() {
                Account acct = [select ID, Name from Account where ID = :accountID Limit 1];
                this.swpnAccount = acct.Name;
        }
        
        //wrapper class for Deployed Strategies and related Action Items                
        public class cDS {
        	public DeployedStrategy__c wDS { get; set; }
        	public Map<Id, List<cAIS>> ais { get; set; }
        	public List<ID> wDSIds { get; set; }
        	
        	//wrapper constructor
        	public cDS(DeployedStrategy__c D, Map<Id,List<cAIS>> aas, List<ID> ids) {
        		wDS = D;
        		ais = aas; 
        		wDSIds = ids;        		
        	}
        } 
        
        //wrapper class for Action Items      
        public class cAIS {
            public DeployedActionItems__c wAI { get; set; }
            public Boolean selected { get; set; }      
            
            //wrapper class constructor
            public cAIS(DeployedActionItems__c c) {
                    wAI = c;
                    selected = false;
            }
        }       
}

 

 

<apex:page sidebar="false" showHeader="true" standardController="SchoolWorkPlanLog__c" extensions="narrativeWizard_Controller">
    <apex:form >
      <apex:pageBlock mode="edit" >  
      <apex:pageBlockButtons >
          <apex:commandButton action="{!processSelected}" value="Save"/>
      </apex:pageBlockButtons>  
      <apex:pageBlockSection title="{!swpnAccount}" >
              <apex:inputField value="{!getLog.Subject__c}"/>
              <apex:inputField value="{!getLog.InteractionDate__c}"/>
          <apex:pageblockSectionItem >
              <apex:inputField value="{!getLog.Narrative__c}"/>
          </apex:pageblockSectionItem>
      </apex:pageBlockSection>     
      <apex:pageBlockSection >
          <apex:PageBlockTable value="{!theWrappers}" var="c">              
               <apex:column headerValue="Strategy">
                  {!c.wDS.Strategy__r.Name }
              </apex:column>
              <apex:column headerValue="End Date" width="125">
                  <apex:outputText value="{0,date,MM-dd-yyyy}">
                      <apex:param value="{!c.wDS.EndDate__c}"/>
                  </apex:outputText>                  
              </apex:column>
              <apex:column breakBefore="true" colspan="2" >                 
                  <apex:outputPanel id="subtable">
                      <apex:dataTable value="{!c.wDSIDs}" var="s" width="100%" border="5px">
                          <apex:column >
                              <apex:outputPanel id="sub-subTable">
                                  <apex:dataTable value="{!c.ais[s]}" var="a" width="100%" border="5px">
                                      <apex:column >
                                          <apex:inputCheckbox value="{!a.selected}"/>
                                      </apex:column>
                                      <apex:column headerValue="Action Items">
                                          {!a.wAI.Name__c}
                                      </apex:column>
                                  </apex:dataTable>
                              </apex:outputPanel>
                          </apex:column>                                                 
                      </apex:dataTable>
                  </apex:outputPanel>
              </apex:column>             
          </apex:PageBlockTable>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>   
</apex:page>

 

 

 

 

 

 

Shashikant SharmaShashikant Sharma

Do these in your apex class

 

1)Create a list of parent records List<Praent__C> listParent = new List<Parent__c>(); , add items in list

2)Create a map which has the parentId as Key and List of child rcords as Values

 Map<ID, List<ChildRecods__c> > mapParentID_ListChilds = new Map<ID, List<ChildRecods__c>>();

here List<ChildRecods__c> should only be the child of that parent only ot all childs

add items in this map

 

3) In VFP

   <apex:pageBlockTable value="{!listParent}" var="parent" >

           //Add columns aas per your req

           <apex:pageBlockTable value="{!mapParentID_ListChilds[parent.id]}" var="child"/>

  </apex:parent>

 

This was selected as the best answer
Shashikant SharmaShashikant Sharma

In case you still face problem please let me know I will provide you complete example.

aKallNVaKallNV

Even closer, but still not there. So now I have the child records grouped properly...each child record is rolling up to the proper parent, but now the my problem is that it shows each grouping twice! I know this is because I'm calling the getTheWrappers method with is the method that populates my wrapper class that has the list and the map. 

 

Is there anyway to call the list and the map directly without calling the method.

 

 

<apex:page sidebar="false" showHeader="true" standardController="SchoolWorkPlanLog__c" extensions="narrativeWizard_Controller">
    <apex:form >
      <apex:pageBlock mode="edit" >  
      <apex:pageBlockButtons >
          <apex:commandButton action="{!processSelected}" value="Save"/>
      </apex:pageBlockButtons>  
      <apex:pageBlockSection title="{!swpnAccount}" >
              <apex:inputField value="{!getLog.Subject__c}"/>
              <apex:inputField value="{!getLog.InteractionDate__c}"/>
          <apex:pageblockSectionItem >
              <apex:inputField value="{!getLog.Narrative__c}"/>
          </apex:pageblockSectionItem>
      </apex:pageBlockSection>     
      <apex:pageBlockSection >
          <apex:repeat value="{!theWrappers}" var="c"> <!--HERE IS WHERE I CALL THE METHOD-->
              <apex:pageBlockTable value="{!c.wDSIds}" var="d"> <!--HERE IS WHERE I WOULD LIKE TO CALL WDSIDS DIRETCLY WITHOUT HAVING TO CALL THE METHOD.-->
                  <apex:column headerValue="Strategy">
                      {!d.Strategy__r.Name }
                  </apex:column>
                  <apex:column headerValue="End Date" width="125">
                      <apex:outputText value="{0,date,MM-dd-yyyy}">
                          <apex:param value="{!d.EndDate__c}"/>
                      </apex:outputText>                  
                  </apex:column>
                  <apex:column >
                      <apex:outputPanel id="sub-subTable">
                          <apex:dataTable value="{!c.ais[d.id]}" var="a" width="100%" border="5px">
                              <apex:column >
                                  <apex:inputCheckbox value="{!a.selected}"/>
                              </apex:column>
                              <apex:column headerValue="Action Items">
                                  {!a.wAI.Name__c}
                              </apex:column>
                          </apex:dataTable>
                      </apex:outputPanel>
                  </apex:column> 
              </apex:pageBlockTable>
          </apex:repeat>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>   
</apex:page>

 

 

aKallNVaKallNV

I finally got it! Thanks for all the help.