• BeautifulDrifter
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 14
    Replies
In my Dev Environment, I have a notification in the top right corner that says 74 Days Remaining.  Is my environment going to be locked when the 74 days are up?

N Days Remaining
I am trying to wrap two aggregate classes into a Wrapper class so I can access both as needed.  

I am getting the following error:  Unknown property 'psqSummaryExt.pmWrap.mSum'

It also appears the pSum isn't returning anything either.  I am guessing I have something wrong in my constructor.  I tried using a map as well.  Code for that at the bottom.  

Any help would be amazing.  Thanks in advance.

Current Apex:
public class psqSummaryExt {
    
    Public PSQ_Header__c Header {get;set;}
    Private Map<Id,List<ModuleSum>> ProdModMap = New Map<Id,List<ModuleSum>>();
    public List<pmWrap> pmWrapout {get; set;}
    private ApexPages.StandardController stdCtrl {get; set;}
    public psqSummaryExt(ApexPages.StandardController std)
        
        
    {
        Header=[select Id from PSQ_Header__c where Id = 'a0541000008gjcm'];
        //Header =(PSQ_Header__c)std.getrecord();
        stdCtrl=std;
        
    }
    
    public psqSummaryExt(){
       pmWrapout = new List<pmWrap>();
    } 
    
    Public Class pmWrap{
        ProductSum pSum {get; set;}
        List<moduleSum> mSum {get; set;}
        
        
    }
    
    public class ProductSum{
        Public String ProdId {get;set;}
        public String ProductName {get; set;}
        public String phc1 {get; set;}
        public String phc2 {get; set;}
        public String phc3 {get; set;}
        public String phc4 {get; set;}
        public String pvariableHours {get; set;}
        Public String phcTotal {get;set;}
        Public ProductSum(string pi, string p,string p1, string p2, string p3, string p4, string pv, string pt){
            this.ProdId = pi;
            this.ProductName = p;
            this.phc1 = p1;
            this.phc2 = p2;
            this.phc3 = p3;
            this.phc4 = p4;
            this.pvariableHours = pv;
            this.phcTotal = pt;
        }
        public List<ModuleSum> ModSumList = new List<ModuleSum>();
        
        
    }
    public class ModuleSum{
        Public List<PSQ_Product__c> Prod {get; set;}
        public String pId {get; set;}
        public String ModuleName {get; set;}
        public String ProductName {get; set;}
        public String mhc1 {get; set;}
        public String mhc2 {get; set;}
        public String mhc3 {get; set;}
        public String mhc4 {get; set;}
        public String mvariableHours {get; set;}
        Public String mhcTotal {get;set;}
        Public ModuleSum(string pId,
            string p,string m,string m1, string m2, string m3, string m4, string mv, string mt){
                this.pId = pId;
                this.ProductName = p;
                this.ModuleName = m;
                this.mhc1 = m1;
                this.mhc2 = m2;
                this.mhc3 = m3;
                this.mhc4 = m4;
                this.mvariableHours = mv;
                this.mhcTotal = mt;
            }
        
    }
    //public List<pmWrap> pmWrapout = New List<pmWrap>();
    
    
    public List<ProductSum> ProductSumList = new List<ProductSum>();
    
    public List<ProductSum> getProductSumOut(){
        
        
        AggregateResult[] productAR = [SELECT PSQ_Application__r.PSQ_Product__r.Id Id
                                       ,PSQ_Application__r.PSQ_Product__r.Name Product
                                       ,SUM(Class_1_Total__c) pc1
                                       ,SUM(Class_2_Total__c) pc2
                                       ,SUM(Class_3_Total__c) pc3
                                       ,SUM(Class_4_Total__c) pc4
                                       ,SUM(Variable_hours__c) pv
                                       ,SUM(Total_Hours__c) pth
                                       FROM PSQ_App_Detail__c WHERE PSQ_Header__c=:Header.Id //and PSQ_Application__r.PSQ_Product__r.Id = :pp.Id
                                       GROUP BY PSQ_Application__r.PSQ_Product__r.Id
                                       ,PSQ_Application__r.PSQ_Product__r.Name]; 
        for (AggregateResult prodList : productAR) { 
            ProductSumList.add(new ProductSum(String.valueOf(prodList.get('Id')),
                                              String.valueOf(prodList.get('Product')),
                                              String.valueOf(prodList.get('pc1'))
                                              , String.valueOf(prodList.get('pc2'))
                                              , String.valueOf(prodList.get('pc3'))
                                              , String.valueOf(prodList.get('pc4'))
                                              , String.valueOf(prodList.get('pv'))
                                              , String.valueOf(prodList.get('pth'))
                                             ));
            
        }
        
        return ProductSumList;
        
    }
    
    public List<ModuleSum> ModuleSumList = new List<ModuleSum>();
    
    
    List<pmWrap> pmWrapper = New List<pmWrap>();
    
    
    public List<ModuleSum> getModuleSumOut(){
        
        
        List<PSQ_Product__c> prods = [select Id from PSQ_Product__c];
        
            For (ProductSum p : ProductSumList){    
            pmWrap pW = New pmWrap();
                
            
            AggregateResult[] moduleAR = [SELECT PSQ_Application__r.PSQ_Product__c prodId
                                          ,PSQ_Application__r.PSQ_Product__r.Name Product
                                          ,PSQ_Application__r.PSQ_Module__r.Name Module
                                          ,SUM(Class_1_Total__c) c1
                                          ,SUM(Class_2_Total__c) c2
                                          ,SUM(Class_3_Total__c) c3
                                          ,SUM(Class_4_Total__c) c4
                                          ,SUM(Variable_hours__c) vh
                                          ,SUM(Total_Hours__c) th
                                          FROM PSQ_App_Detail__c WHERE PSQ_Header__c=:Header.Id and PSQ_Application__r.PSQ_Product__c = :p.prodId
                                          GROUP BY PSQ_Application__r.PSQ_Product__c
                                          ,PSQ_Application__r.PSQ_Product__r.Name 
                                          ,PSQ_Application__r.PSQ_Module__r.Name]; 
            for (AggregateResult modList : moduleAR) {
                //PSQ_Product__c prod = [select Id from PSQ_Product__c where Id = :modList.get('prodId')];
                
                //List<ModuleSum> msList = New List<ModuleSum>();
                ModuleSumList.add(new ModuleSum(String.valueOf(modList.get('prodId')),
                    String.valueOf(modList.get('Product'))
                    ,String.valueOf(modList.get('Module'))
                    , String.valueOf(modList.get('c1'))
                    , String.valueOf(modList.get('c2'))
                    , String.valueOf(modList.get('c3'))
                    , String.valueOf(modList.get('c4'))
                    , String.valueOf(modList.get('vh'))
                    , String.valueOf(modList.get('th'))
                ));
                //ModuleSumList.addall(msList);
            
                
                
            }
             pW.pSum = p;
             pW.mSum=ModuleSumList;   
            return ModuleSumList;
            
          pmWrapout.add(pW);     
          system.debug(pmWrapout);      
            ProdModMap.put(p.prodId, ModuleSumList);
            system.debug('Add p.Id and msList to Map.  Product ID:'+p.ProdId + ' msList size: '+ModuleSumList.size());
           
            
            
        }
        
        return Null;
    }

        
}

VF:
<apex:pageblock title="Wrapper Summary">
        <apex:repeat value="{!pmWrapout}" var="pw" >
            <apex:pageBlockSection title="pw.pSum.Name">
                <apex:pageblocktable value="{!pw.mSum}" var="mSum">
                    <apex:column value="{!mSum.ModuleName}" headervalue="Module" />
                    <apex:column value="{!mSum.mhc1}" headervalue="Consulting Hours" />
                    <apex:column value="{!mSum.mhc2}" headervalue="Development Hours" />
                    <apex:column value="{!mSum.mhc3}" headervalue="QA Hours" />
                    <apex:column value="{!mSum.mhc4}" headervalue="Hours Class 4" rendered="false"/>
                    <apex:column value="{!mSum.mvariableHours}" headervalue="Variable Hours" rendered="True"/>
                    <apex:column value="{!mSum.mhcTotal}" headervalue="Total Hours" rendered="True"/>
                </apex:pageblocktable>
            </apex:pageBlockSection>
        </apex:repeat>     
    </apex:pageblock>

Map Apex (removed):
List<pmWrap> pmWrapper= New List<pmWrap>();
    
    public List<pmWrap> getpmWrapout(){
        for (ProductSum ps : ProductSumList ){ 
            pmWrap pW = New pmWrap();
            pW.pSum = ps;
            //system.debug('ProductSum to add: '+ps);
           List <ModuleSum> modSum = New List <ModuleSum>();
            for (ModuleSum ms : ProdModMap.get(ps.ProdId)){
                modSum.add(ms);
            }
            pW.mSum=modSum;
          pmWrapper.add(pW);  
        }
       return pmWrapper;     
    }

 
 AggregateResult[] groupedResults
            = [SELECT Detail_Question__r.PSQ_Applications__c, count(Id)
               FROM PSQ_Detail__c
               WHERE Detail_Question__r.App_dependency__c = Answer__c 
               AND PSQ_Header__c = :stdCtrl.getId()
               GROUP BY Detail_Question__r.PSQ_Applications__c];

I am getting an error on the where clause: expecting a colon, found 'Answer__c'

Any help would be appreciated.  Thanks in advance!
Ok...so I am relatively new to this and have hit a wall.  That being said, I have tried this a few way.  I'm sure this will end up being something minor. 

Basically, I am creating a questionaire, and breaking the questions out by category.  I have the data and have it rendering correctly in VF.  The issue is with trying to update the answers that are entered.  Also, please note that the answers are dependent picklists.  Below is an image of the page, and my two primary attempts at this.  You may see some random extra code/buttons from me trying different things to update the data.  I just need to update records with the entered answers within the VF page.

Questionaire


First try:

APEX:
public class CatDeetsEx {
    
    Public List<PSQ_Category__c> CategoriesList {get;set;}
    Public List<PSQ_Detail__c> DetailsList {get;set;}
    
    
    private ApexPages.StandardController stdCtrl {get; set;}
    public CatDeetsEx(ApexPages.StandardController std)
        
    {
        stdCtrl=std;
        setDeetsList();
        
    }
Private void SetDeetsList()
    {
        CategoriesList = [Select Id,Name, (select Id,PSQ_Category__c,PSQ_Header__c,Pick_List_Type__c ,Answer__c,Question__c from PSQ_Details__r 
                                          ) from PSQ_Category__c where Id in (select PSQ_Category__c from PSQ_Detail__c where PSQ_Header__c=:stdCtrl.getId())];
        
    }
    Public PageReference saveAll(){
        
        update CategoriesList.PSQ_Details__r;

    }
    
}
VisualForce:
<apex:pageBlock >

                    <apex:repeat value="{!CategoriesList}" var="cl">
                        <apex:pageBlockSection title="{!cl.Name}" id="catSection">
                                                     
                            <apex:pageBlockTable id="detsTable" value="{!cl.PSQ_Details__r}" var="dl">
                                <apex:column value="{!dl.Question__c}" /> 
                                <apex:column >
                                    <apex:inputField value="{!dl.Pick_List_Type__c}"  id="ParentPL" style="display:none" />
                                </apex:column>
                                <apex:column > 
                                    <apex:inputField value="{!dl.Answer__c}" id="deetAnswer" />
                                    <apex:actionSupport event="onchange" action="{!updateAnswer}" rerender="dets"/>
                                    <apex:param assignTo="{!RecToUpd}" value="{!dl.Id}"/>
                                    <apex:param assignTo="{!updAnswer}" value="{!dl.Answer__c}"/>
                                </apex:column>
                            </apex:pageBlockTable>
                        </apex:pageBlockSection> 
                        <apex:commandButton value="Save" action="{!saveAll}" reRender="catBlockSection"/>
                    </apex:repeat>
                </apex:pageBlock>
Error:  Initial term of field expression must be a concrete SObject: List<PSQ_Category__c>

Ok Ok.  Got it, Salesforce isn't going to make this simple.  So, I do a little research, and the natural first response to a post like this would be WRAPPER CLASS! 
So, I went and wrote (copy/paste/tweaked) a wrapper, it renders correctly, but I can't figure out how to update the values.  See below. 

APEX:
public class CatWrapExt {
    
    private ApexPages.StandardController stdCtrl {get; set;}
    public CatWrapExt(ApexPages.StandardController std)
    {
        stdCtrl=std;
        CatWrapExt();
    }       
    
    
    private List<PSQ_Category__c> tempcat = new List<PSQ_Category__c>();
    private List<PSQ_Detail__c> tempD = new List<PSQ_Detail__c>();
    private List<PSQ_Question__c> tempQ = new List<PSQ_Question__c>();    
    private Map<ID,List<PSQ_Detail__c>> catdetMAP = new Map<ID,List<PSQ_Detail__c>>();
    private Set<ID> catIDs = new Set<ID>();//category ids to get details from
    public List<wrapper> wrapout {get; set;}
    //constructor
    public void CatWrapExt(){
        wrapout = new List<wrapper>();
    }   
    //wrapper 1
    class wrapper{
        public PSQ_Category__c cat {get; set;}
        //List of wrappers
        public List<wrapper2> dets {get; set;}
        
        public wrapper(){
            if(cat==null){cat = new PSQ_Category__c();}//initialize the category holder
            if(dets==null){dets = new List<wrapper2>();}//initialize the wrapper listholder
 
        }
    }
    //wrapper 2 - the sub-wrapper
    class wrapper2{
        public PSQ_Detail__c det {get; set;}
        Public String Answer {get;set;}
        
        //public List<Product2> detprods {get; set;}
        public wrapper2(PSQ_Detail__c det,string Answer
        ){
            if(det==null){det = new PSQ_Detail__c();}//initialize the Detail holder
            
        }
      public void updateDets(){
          //list<psq_detail__c> detUpdate = New List <psq_detail__c>();
          update det;
            }   
        
    }
    
    public PageReference buildwrapper() {
        tempcat = [select id,name from PSQ_Category__c where Id in (Select PSQ_Category__c from PSQ_Record_Category__c 
                                                                    where PSQ_Header__c = :stdCtrl.getId() AND Need__c = True) ];
        for(PSQ_Category__c c:tempcat){catIDs.add(c.id);}
        tempD = [select Id,Detail_Question__c,Question__c,Pick_List_Type__c,Answer__c from PSQ_Detail__c 
                 where PSQ_Header__c =:stdCtrl.getId()];
        for(PSQ_Detail__c d: TempD){
            tempQ = [select Id,PSQ_Category__c from PSQ_Question__c where Id = :d.Detail_Question__c];
            for (PSQ_Question__c q: TempQ){
                if(catdetMap.containsKey(q.PSQ_Category__c)){
                    catdetMap.get(q.PSQ_Category__c).add(d);//adds detail for this category to the det list in the map
                }else{
                    catdetMap.put(q.PSQ_Category__c,new List<PSQ_Detail__c>{d});//adds new detail list for this category to the map
                }
            }
            
        }
        for(PSQ_Category__c cc:tempcat){
            wrapper tmpwrapper = new wrapper();
            tmpwrapper.cat=cc;
            List<wrapper2> t2 = new List<wrapper2>();
            for(PSQ_Detail__c dd:catdetMap.get(cc.id)){
                wrapper2 twrap2 = new wrapper2(dd ,dd.Answer__c);
                twrap2.det=dd;
                twrap2.Answer=dd.Answer__c;
                t2.add(twrap2);
                  
            }
            tmpwrapper.dets=t2;
            wrapout.add(tmpwrapper);

        }
        
        return null;
        
    }
}

Visualforce:
<apex:repeat value="{!wrapout}" var="w">
                        <apex:pageBlockSection title="{!w.cat.name}" id="catBlockSection">
                            <hr/>
                            <apex:outputText value="" /> 
                            <apex:pageBlockTable id="detsBT" value="{!w.dets}" var="wd">
                                <apex:column value="{!wd.det.Question__c}" /> 
                                <apex:column >
                                    <apex:inputField value="{!wd.det.Pick_List_Type__c}"  id="ParentPicklist" style="display:none" />
                                </apex:column>
                                <apex:column > 
                                    <apex:selectList value="{!wd.Answer}" id="answer" />
                                    <apex:selectOptions value="{!level1items}"/>
                                    <apex:actionSupport event="onblur" action="{!updateAnswer}" rerender="dets"/>
                                    <apex:param assignTo="{!RecToUpd}" value="{!wd.det.Id}"/>
                                    <apex:param assignTo="{!updAnswer}" value="{!wd.det.Answer__c}"/>
                                </apex:column>
                            </apex:pageBlockTable>
                        </apex:pageBlockSection> 
                        <apex:commandButton value="Save" action="{!updateTableAnswers}" reRender="catBlockSection"/>
                    </apex:repeat>
For the wrapper, the issue is I can't update the answers without defining them in the constructor.  But if I define them in the constructor and then reference them in the VF page, the drop down does not render since the type string. 

<apex:selectList value="{!wd.Answer}" id="answer" />  | Doesn't render as picklist

<apex:selectList value="{!wd.det.Answer__c}" id="answer" />  | Can't figure out how to update the value

I also tried actionsupport and passing params from the page for both onchange and onblur.  I feel like this has become way more complicated than it should be.  The one thing I DO NOT want to do is put a save button on each individual line of the table so every time someone answers a question they then have to save it. 

Any help would be imensely appreciated as this is a sticking point that I need to work to move forward with what I am building.

Thanks in advance!

 
Need help here.  I have a record within a PageBlockTable and added a button to delete the record.  I am doing this on another tab of the same page and it is working fine.  For some reason I cannot get this to work.

Pulling the primary data for the table
 
Private void setAppDetail(){
        AppDetails = [select Id,Name,PSQ_Application__c,Instances__c from PSQ_App_Detail__c where PSQ_Header__c = :Header.Id];
        
        
    }

Here is the VF:
 
<apex:pageBlock title="Line Items" id="AppLineItems">
                        <apex:pageBlockTable value="{!AppDetails}" id="appDet" var="ad">
                        <apex:column title="Name" value="{!ad.Name}"/>
                        <apex:column title="Socket" value="{!ad.PSQ_Application__c}"/>
                        <apex:column title="Instances" value="{!ad.Instances__c}"/>
                        <apex:column >
                        <apex:commandButton value="Remove App" action="{!removeApp}" id="removeApp" reRender="AppLineItems" >
                            <apex:param name="AppId" value="{!ad.id}" assignTo="{!AppId}"/>
                        </apex:commandButton>
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlock>

Below is the Apex for the action.  You can also see all of the different ways I have tried to delete this record (marked out).  
 
//public PSQ_App_Detail__c AppId {get; set;}
    public string AppId {get; set;}
    public PageReference removeApp() 
    {
        //PSQ_App_Detail__c deleteApp = AppId;
        PSQ_App_Detail__c deleteApp = new PSQ_App_Detail__c(Id = AppId);
        //PSQ_App_Detail__c DeleteApp = [select Id from PSQ_App_Detail__c where Id = :AppId];
        //delete AppId;
                
        delete DeleteApp;
                
        setAppDetail();
        
        return null;
    }

Any help would be much appreciated.  Thanks in advance!
 
In my Dev Environment, I have a notification in the top right corner that says 74 Days Remaining.  Is my environment going to be locked when the 74 days are up?

N Days Remaining
I am trying to wrap two aggregate classes into a Wrapper class so I can access both as needed.  

I am getting the following error:  Unknown property 'psqSummaryExt.pmWrap.mSum'

It also appears the pSum isn't returning anything either.  I am guessing I have something wrong in my constructor.  I tried using a map as well.  Code for that at the bottom.  

Any help would be amazing.  Thanks in advance.

Current Apex:
public class psqSummaryExt {
    
    Public PSQ_Header__c Header {get;set;}
    Private Map<Id,List<ModuleSum>> ProdModMap = New Map<Id,List<ModuleSum>>();
    public List<pmWrap> pmWrapout {get; set;}
    private ApexPages.StandardController stdCtrl {get; set;}
    public psqSummaryExt(ApexPages.StandardController std)
        
        
    {
        Header=[select Id from PSQ_Header__c where Id = 'a0541000008gjcm'];
        //Header =(PSQ_Header__c)std.getrecord();
        stdCtrl=std;
        
    }
    
    public psqSummaryExt(){
       pmWrapout = new List<pmWrap>();
    } 
    
    Public Class pmWrap{
        ProductSum pSum {get; set;}
        List<moduleSum> mSum {get; set;}
        
        
    }
    
    public class ProductSum{
        Public String ProdId {get;set;}
        public String ProductName {get; set;}
        public String phc1 {get; set;}
        public String phc2 {get; set;}
        public String phc3 {get; set;}
        public String phc4 {get; set;}
        public String pvariableHours {get; set;}
        Public String phcTotal {get;set;}
        Public ProductSum(string pi, string p,string p1, string p2, string p3, string p4, string pv, string pt){
            this.ProdId = pi;
            this.ProductName = p;
            this.phc1 = p1;
            this.phc2 = p2;
            this.phc3 = p3;
            this.phc4 = p4;
            this.pvariableHours = pv;
            this.phcTotal = pt;
        }
        public List<ModuleSum> ModSumList = new List<ModuleSum>();
        
        
    }
    public class ModuleSum{
        Public List<PSQ_Product__c> Prod {get; set;}
        public String pId {get; set;}
        public String ModuleName {get; set;}
        public String ProductName {get; set;}
        public String mhc1 {get; set;}
        public String mhc2 {get; set;}
        public String mhc3 {get; set;}
        public String mhc4 {get; set;}
        public String mvariableHours {get; set;}
        Public String mhcTotal {get;set;}
        Public ModuleSum(string pId,
            string p,string m,string m1, string m2, string m3, string m4, string mv, string mt){
                this.pId = pId;
                this.ProductName = p;
                this.ModuleName = m;
                this.mhc1 = m1;
                this.mhc2 = m2;
                this.mhc3 = m3;
                this.mhc4 = m4;
                this.mvariableHours = mv;
                this.mhcTotal = mt;
            }
        
    }
    //public List<pmWrap> pmWrapout = New List<pmWrap>();
    
    
    public List<ProductSum> ProductSumList = new List<ProductSum>();
    
    public List<ProductSum> getProductSumOut(){
        
        
        AggregateResult[] productAR = [SELECT PSQ_Application__r.PSQ_Product__r.Id Id
                                       ,PSQ_Application__r.PSQ_Product__r.Name Product
                                       ,SUM(Class_1_Total__c) pc1
                                       ,SUM(Class_2_Total__c) pc2
                                       ,SUM(Class_3_Total__c) pc3
                                       ,SUM(Class_4_Total__c) pc4
                                       ,SUM(Variable_hours__c) pv
                                       ,SUM(Total_Hours__c) pth
                                       FROM PSQ_App_Detail__c WHERE PSQ_Header__c=:Header.Id //and PSQ_Application__r.PSQ_Product__r.Id = :pp.Id
                                       GROUP BY PSQ_Application__r.PSQ_Product__r.Id
                                       ,PSQ_Application__r.PSQ_Product__r.Name]; 
        for (AggregateResult prodList : productAR) { 
            ProductSumList.add(new ProductSum(String.valueOf(prodList.get('Id')),
                                              String.valueOf(prodList.get('Product')),
                                              String.valueOf(prodList.get('pc1'))
                                              , String.valueOf(prodList.get('pc2'))
                                              , String.valueOf(prodList.get('pc3'))
                                              , String.valueOf(prodList.get('pc4'))
                                              , String.valueOf(prodList.get('pv'))
                                              , String.valueOf(prodList.get('pth'))
                                             ));
            
        }
        
        return ProductSumList;
        
    }
    
    public List<ModuleSum> ModuleSumList = new List<ModuleSum>();
    
    
    List<pmWrap> pmWrapper = New List<pmWrap>();
    
    
    public List<ModuleSum> getModuleSumOut(){
        
        
        List<PSQ_Product__c> prods = [select Id from PSQ_Product__c];
        
            For (ProductSum p : ProductSumList){    
            pmWrap pW = New pmWrap();
                
            
            AggregateResult[] moduleAR = [SELECT PSQ_Application__r.PSQ_Product__c prodId
                                          ,PSQ_Application__r.PSQ_Product__r.Name Product
                                          ,PSQ_Application__r.PSQ_Module__r.Name Module
                                          ,SUM(Class_1_Total__c) c1
                                          ,SUM(Class_2_Total__c) c2
                                          ,SUM(Class_3_Total__c) c3
                                          ,SUM(Class_4_Total__c) c4
                                          ,SUM(Variable_hours__c) vh
                                          ,SUM(Total_Hours__c) th
                                          FROM PSQ_App_Detail__c WHERE PSQ_Header__c=:Header.Id and PSQ_Application__r.PSQ_Product__c = :p.prodId
                                          GROUP BY PSQ_Application__r.PSQ_Product__c
                                          ,PSQ_Application__r.PSQ_Product__r.Name 
                                          ,PSQ_Application__r.PSQ_Module__r.Name]; 
            for (AggregateResult modList : moduleAR) {
                //PSQ_Product__c prod = [select Id from PSQ_Product__c where Id = :modList.get('prodId')];
                
                //List<ModuleSum> msList = New List<ModuleSum>();
                ModuleSumList.add(new ModuleSum(String.valueOf(modList.get('prodId')),
                    String.valueOf(modList.get('Product'))
                    ,String.valueOf(modList.get('Module'))
                    , String.valueOf(modList.get('c1'))
                    , String.valueOf(modList.get('c2'))
                    , String.valueOf(modList.get('c3'))
                    , String.valueOf(modList.get('c4'))
                    , String.valueOf(modList.get('vh'))
                    , String.valueOf(modList.get('th'))
                ));
                //ModuleSumList.addall(msList);
            
                
                
            }
             pW.pSum = p;
             pW.mSum=ModuleSumList;   
            return ModuleSumList;
            
          pmWrapout.add(pW);     
          system.debug(pmWrapout);      
            ProdModMap.put(p.prodId, ModuleSumList);
            system.debug('Add p.Id and msList to Map.  Product ID:'+p.ProdId + ' msList size: '+ModuleSumList.size());
           
            
            
        }
        
        return Null;
    }

        
}

VF:
<apex:pageblock title="Wrapper Summary">
        <apex:repeat value="{!pmWrapout}" var="pw" >
            <apex:pageBlockSection title="pw.pSum.Name">
                <apex:pageblocktable value="{!pw.mSum}" var="mSum">
                    <apex:column value="{!mSum.ModuleName}" headervalue="Module" />
                    <apex:column value="{!mSum.mhc1}" headervalue="Consulting Hours" />
                    <apex:column value="{!mSum.mhc2}" headervalue="Development Hours" />
                    <apex:column value="{!mSum.mhc3}" headervalue="QA Hours" />
                    <apex:column value="{!mSum.mhc4}" headervalue="Hours Class 4" rendered="false"/>
                    <apex:column value="{!mSum.mvariableHours}" headervalue="Variable Hours" rendered="True"/>
                    <apex:column value="{!mSum.mhcTotal}" headervalue="Total Hours" rendered="True"/>
                </apex:pageblocktable>
            </apex:pageBlockSection>
        </apex:repeat>     
    </apex:pageblock>

Map Apex (removed):
List<pmWrap> pmWrapper= New List<pmWrap>();
    
    public List<pmWrap> getpmWrapout(){
        for (ProductSum ps : ProductSumList ){ 
            pmWrap pW = New pmWrap();
            pW.pSum = ps;
            //system.debug('ProductSum to add: '+ps);
           List <ModuleSum> modSum = New List <ModuleSum>();
            for (ModuleSum ms : ProdModMap.get(ps.ProdId)){
                modSum.add(ms);
            }
            pW.mSum=modSum;
          pmWrapper.add(pW);  
        }
       return pmWrapper;     
    }

 
 AggregateResult[] groupedResults
            = [SELECT Detail_Question__r.PSQ_Applications__c, count(Id)
               FROM PSQ_Detail__c
               WHERE Detail_Question__r.App_dependency__c = Answer__c 
               AND PSQ_Header__c = :stdCtrl.getId()
               GROUP BY Detail_Question__r.PSQ_Applications__c];

I am getting an error on the where clause: expecting a colon, found 'Answer__c'

Any help would be appreciated.  Thanks in advance!
Ok...so I am relatively new to this and have hit a wall.  That being said, I have tried this a few way.  I'm sure this will end up being something minor. 

Basically, I am creating a questionaire, and breaking the questions out by category.  I have the data and have it rendering correctly in VF.  The issue is with trying to update the answers that are entered.  Also, please note that the answers are dependent picklists.  Below is an image of the page, and my two primary attempts at this.  You may see some random extra code/buttons from me trying different things to update the data.  I just need to update records with the entered answers within the VF page.

Questionaire


First try:

APEX:
public class CatDeetsEx {
    
    Public List<PSQ_Category__c> CategoriesList {get;set;}
    Public List<PSQ_Detail__c> DetailsList {get;set;}
    
    
    private ApexPages.StandardController stdCtrl {get; set;}
    public CatDeetsEx(ApexPages.StandardController std)
        
    {
        stdCtrl=std;
        setDeetsList();
        
    }
Private void SetDeetsList()
    {
        CategoriesList = [Select Id,Name, (select Id,PSQ_Category__c,PSQ_Header__c,Pick_List_Type__c ,Answer__c,Question__c from PSQ_Details__r 
                                          ) from PSQ_Category__c where Id in (select PSQ_Category__c from PSQ_Detail__c where PSQ_Header__c=:stdCtrl.getId())];
        
    }
    Public PageReference saveAll(){
        
        update CategoriesList.PSQ_Details__r;

    }
    
}
VisualForce:
<apex:pageBlock >

                    <apex:repeat value="{!CategoriesList}" var="cl">
                        <apex:pageBlockSection title="{!cl.Name}" id="catSection">
                                                     
                            <apex:pageBlockTable id="detsTable" value="{!cl.PSQ_Details__r}" var="dl">
                                <apex:column value="{!dl.Question__c}" /> 
                                <apex:column >
                                    <apex:inputField value="{!dl.Pick_List_Type__c}"  id="ParentPL" style="display:none" />
                                </apex:column>
                                <apex:column > 
                                    <apex:inputField value="{!dl.Answer__c}" id="deetAnswer" />
                                    <apex:actionSupport event="onchange" action="{!updateAnswer}" rerender="dets"/>
                                    <apex:param assignTo="{!RecToUpd}" value="{!dl.Id}"/>
                                    <apex:param assignTo="{!updAnswer}" value="{!dl.Answer__c}"/>
                                </apex:column>
                            </apex:pageBlockTable>
                        </apex:pageBlockSection> 
                        <apex:commandButton value="Save" action="{!saveAll}" reRender="catBlockSection"/>
                    </apex:repeat>
                </apex:pageBlock>
Error:  Initial term of field expression must be a concrete SObject: List<PSQ_Category__c>

Ok Ok.  Got it, Salesforce isn't going to make this simple.  So, I do a little research, and the natural first response to a post like this would be WRAPPER CLASS! 
So, I went and wrote (copy/paste/tweaked) a wrapper, it renders correctly, but I can't figure out how to update the values.  See below. 

APEX:
public class CatWrapExt {
    
    private ApexPages.StandardController stdCtrl {get; set;}
    public CatWrapExt(ApexPages.StandardController std)
    {
        stdCtrl=std;
        CatWrapExt();
    }       
    
    
    private List<PSQ_Category__c> tempcat = new List<PSQ_Category__c>();
    private List<PSQ_Detail__c> tempD = new List<PSQ_Detail__c>();
    private List<PSQ_Question__c> tempQ = new List<PSQ_Question__c>();    
    private Map<ID,List<PSQ_Detail__c>> catdetMAP = new Map<ID,List<PSQ_Detail__c>>();
    private Set<ID> catIDs = new Set<ID>();//category ids to get details from
    public List<wrapper> wrapout {get; set;}
    //constructor
    public void CatWrapExt(){
        wrapout = new List<wrapper>();
    }   
    //wrapper 1
    class wrapper{
        public PSQ_Category__c cat {get; set;}
        //List of wrappers
        public List<wrapper2> dets {get; set;}
        
        public wrapper(){
            if(cat==null){cat = new PSQ_Category__c();}//initialize the category holder
            if(dets==null){dets = new List<wrapper2>();}//initialize the wrapper listholder
 
        }
    }
    //wrapper 2 - the sub-wrapper
    class wrapper2{
        public PSQ_Detail__c det {get; set;}
        Public String Answer {get;set;}
        
        //public List<Product2> detprods {get; set;}
        public wrapper2(PSQ_Detail__c det,string Answer
        ){
            if(det==null){det = new PSQ_Detail__c();}//initialize the Detail holder
            
        }
      public void updateDets(){
          //list<psq_detail__c> detUpdate = New List <psq_detail__c>();
          update det;
            }   
        
    }
    
    public PageReference buildwrapper() {
        tempcat = [select id,name from PSQ_Category__c where Id in (Select PSQ_Category__c from PSQ_Record_Category__c 
                                                                    where PSQ_Header__c = :stdCtrl.getId() AND Need__c = True) ];
        for(PSQ_Category__c c:tempcat){catIDs.add(c.id);}
        tempD = [select Id,Detail_Question__c,Question__c,Pick_List_Type__c,Answer__c from PSQ_Detail__c 
                 where PSQ_Header__c =:stdCtrl.getId()];
        for(PSQ_Detail__c d: TempD){
            tempQ = [select Id,PSQ_Category__c from PSQ_Question__c where Id = :d.Detail_Question__c];
            for (PSQ_Question__c q: TempQ){
                if(catdetMap.containsKey(q.PSQ_Category__c)){
                    catdetMap.get(q.PSQ_Category__c).add(d);//adds detail for this category to the det list in the map
                }else{
                    catdetMap.put(q.PSQ_Category__c,new List<PSQ_Detail__c>{d});//adds new detail list for this category to the map
                }
            }
            
        }
        for(PSQ_Category__c cc:tempcat){
            wrapper tmpwrapper = new wrapper();
            tmpwrapper.cat=cc;
            List<wrapper2> t2 = new List<wrapper2>();
            for(PSQ_Detail__c dd:catdetMap.get(cc.id)){
                wrapper2 twrap2 = new wrapper2(dd ,dd.Answer__c);
                twrap2.det=dd;
                twrap2.Answer=dd.Answer__c;
                t2.add(twrap2);
                  
            }
            tmpwrapper.dets=t2;
            wrapout.add(tmpwrapper);

        }
        
        return null;
        
    }
}

Visualforce:
<apex:repeat value="{!wrapout}" var="w">
                        <apex:pageBlockSection title="{!w.cat.name}" id="catBlockSection">
                            <hr/>
                            <apex:outputText value="" /> 
                            <apex:pageBlockTable id="detsBT" value="{!w.dets}" var="wd">
                                <apex:column value="{!wd.det.Question__c}" /> 
                                <apex:column >
                                    <apex:inputField value="{!wd.det.Pick_List_Type__c}"  id="ParentPicklist" style="display:none" />
                                </apex:column>
                                <apex:column > 
                                    <apex:selectList value="{!wd.Answer}" id="answer" />
                                    <apex:selectOptions value="{!level1items}"/>
                                    <apex:actionSupport event="onblur" action="{!updateAnswer}" rerender="dets"/>
                                    <apex:param assignTo="{!RecToUpd}" value="{!wd.det.Id}"/>
                                    <apex:param assignTo="{!updAnswer}" value="{!wd.det.Answer__c}"/>
                                </apex:column>
                            </apex:pageBlockTable>
                        </apex:pageBlockSection> 
                        <apex:commandButton value="Save" action="{!updateTableAnswers}" reRender="catBlockSection"/>
                    </apex:repeat>
For the wrapper, the issue is I can't update the answers without defining them in the constructor.  But if I define them in the constructor and then reference them in the VF page, the drop down does not render since the type string. 

<apex:selectList value="{!wd.Answer}" id="answer" />  | Doesn't render as picklist

<apex:selectList value="{!wd.det.Answer__c}" id="answer" />  | Can't figure out how to update the value

I also tried actionsupport and passing params from the page for both onchange and onblur.  I feel like this has become way more complicated than it should be.  The one thing I DO NOT want to do is put a save button on each individual line of the table so every time someone answers a question they then have to save it. 

Any help would be imensely appreciated as this is a sticking point that I need to work to move forward with what I am building.

Thanks in advance!

 
Need help here.  I have a record within a PageBlockTable and added a button to delete the record.  I am doing this on another tab of the same page and it is working fine.  For some reason I cannot get this to work.

Pulling the primary data for the table
 
Private void setAppDetail(){
        AppDetails = [select Id,Name,PSQ_Application__c,Instances__c from PSQ_App_Detail__c where PSQ_Header__c = :Header.Id];
        
        
    }

Here is the VF:
 
<apex:pageBlock title="Line Items" id="AppLineItems">
                        <apex:pageBlockTable value="{!AppDetails}" id="appDet" var="ad">
                        <apex:column title="Name" value="{!ad.Name}"/>
                        <apex:column title="Socket" value="{!ad.PSQ_Application__c}"/>
                        <apex:column title="Instances" value="{!ad.Instances__c}"/>
                        <apex:column >
                        <apex:commandButton value="Remove App" action="{!removeApp}" id="removeApp" reRender="AppLineItems" >
                            <apex:param name="AppId" value="{!ad.id}" assignTo="{!AppId}"/>
                        </apex:commandButton>
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlock>

Below is the Apex for the action.  You can also see all of the different ways I have tried to delete this record (marked out).  
 
//public PSQ_App_Detail__c AppId {get; set;}
    public string AppId {get; set;}
    public PageReference removeApp() 
    {
        //PSQ_App_Detail__c deleteApp = AppId;
        PSQ_App_Detail__c deleteApp = new PSQ_App_Detail__c(Id = AppId);
        //PSQ_App_Detail__c DeleteApp = [select Id from PSQ_App_Detail__c where Id = :AppId];
        //delete AppId;
                
        delete DeleteApp;
                
        setAppDetail();
        
        return null;
    }

Any help would be much appreciated.  Thanks in advance!