+ Start a Discussion
❤Code❤Code 

Data not displaying on vf page pageblocktable

Hi,

I have a vf page which on action:support firing needs to display all the fields. But i am able to not able to get all the fields displayed in pageblocksection fields. Can anyone help me out in this .

VF Page - 
 
<apex:pageBlockTable id="thetable"  var="acc" value="{!attendeeList1}" onRowMouseOver="removeHighlight(this)">
        
             <apex:column headerValue="Action" >
            <apex:commandLink value="Copy" reRender="pb" onclick="testMe(event)"/>
          </apex:column>
          
          <apex:column headerValue="Custom Package">
                 <apex:param name="rowIndex" value="{!rowNumber}"/>
                         <apex:selectList multiselect="true" value="{!acc.discountSchedule}"  styleClass="fullWidth chzn-select" size="1" style="width:400px;" >
                          <apex:actionSupport event="onchange" action="{!acc.updateMarketOptions}" rerender="geographies"  oncomplete="renderChosen()"/>
                        <apex:selectOptions value="{!Dept}"/>
                      </apex:selectList> 
                <apex:variable var="rowNumber" value="{!rowNumber+1}"/> 
          </apex:column>
           

          <apex:column headerValue="Market" id="market">
            <apex:outputPanel id="geographies" layout="block" >
          <apex:selectList id="selectedmarkets" multiselect="false" value="{!acc.discountSchedule1}"  styleClass="fullWidth chzn-select" size="1" style="width:150px" >
                
              <apex:selectOptions value="{!acc.marketOptions}"/>
             </apex:selectList> 
            </apex:outputPanel>
          </apex:column>
          
          <apex:column headerValue="State" >
            <apex:inputField value="{!acc.cp.State__c}" styleClass="twitterStyleTextbox"/>
          </apex:column>
          <apex:column headerValue="First Issue" >
            <apex:inputField value="{!acc.cp.First_Issue__c}" styleClass="twitterStyleTextbox"/>
          </apex:column>
          <apex:column headerValue="Last Issue" >
            <apex:inputField value="{!acc.cp.Last_Issue__c}" styleClass="twitterStyleTextbox"/>
          </apex:column>
          <apex:column headerValue="Circulation" >
            <apex:inputField value="{!acc.cp.Circulation__c}" styleClass="twitterStyleTextbox"/>
          </apex:column>
            <apex:column headerValue="Space Unit">
            <apex:inputField value="{!acc.cp.Space_Unit__c }" styleClass="chzn-select"/>
          </apex:column>
          <apex:column headerValue="Space Discount">
          <apex:inputField value="{!acc.cp.Space_Discount__c}" styleClass="twitterStyleTextbox"/>
          </apex:column>
           <apex:column headerValue="Per Unit Open Rate">
          <apex:inputField value="{!acc.cp.Per_Unit_Open_Rate__c}" styleClass="twitterStyleTextbox"/>
          </apex:column>
  <!--         <apex:column headerValue="Action">
          <apex:commandLink value="Delete" reRender="pb"  oncomplete="renderChosen()" action="{!deleteLanguage}" />
          </apex:column> -->
          <apex:column width="25px" headerValue="Remove">
           <apex:inputCheckbox value="{!acc.checked}">
           <apex:actionSupport event="onchange" action="{!deleteLanguage}" rerender="pb"  oncomplete="renderChosen()"/>
           </apex:inputCheckbox>
            </apex:column>
        </apex:pageBlockTable>

Apex Class - 
 
public with sharing class RFPController{

        public RFP__c accounts{get;set;}
        public Custom_Package__c del;
        public List < Custom_Package__c > addattendeeList {get;set;}
        public List < Custom_Package__c > delattendeeList {get;set;}
        public List < Custom_Package__c > attendeeList {get;set;}
        public Integer totalCount {get;set;}
        public Integer rowIndex {get;set;}
        public Integer deleterowIndex {get;set;}
        public List < Custom_Package__c > delAttendees {get;set;}
        public Boolean isRerender{get;set;}
         public Integer numberOfRowToRemove { get; set; }
         public String selectedRowIndex{get;set;} 
         public Integer c{get; set;} 
         private List<SelectOption> options;
         public List<SelectOption> AllName{get;set;}
         public List<SelectOption> AllDept{get;set;}
        public String discountScheduleID2 { get; set; }
        public  string mark {get; set;}
        public Integer rowNum{get;set;}
             

        private List<Custom_Package__c>  acc {get;set;}
        
        public RFPController(ApexPages.StandardController controller) {

                isRerender = false;
                accounts =  (RFP__c )controller.getRecord();
              /*  String S = 'Select id, Name, Market__c, State__c, First_Issue__c,Last_Issue__c,Circulation__c,Space_Unit__c,Per_Unit_Open_Rate__c,Space_Discount__c from Custom_Package__c ';
                //totalCount = attendeeList.size();
                attendeeList  = Database.Query(S);
                attendeeList = new List < Custom_Package__c >();
          
                delattendeeList = new List < Custom_Package__c > ();
                delattendees = new List < Custom_Package__c > (); */
               
                accounts.Rep_Name__c= Userinfo.getuserId();
                c=0;
               //AllName = getMarket();
                //Alldept = getDept();
                attendeeList1 = new List<CustomPackageWrapper>();
                for(integer i=0;i<5;i++){
                
                CustomPackageWrapper cw1 = new CustomPackageWrapper(new Custom_Package__c());
                cw1.rowIndex=0;
                //cw1.discountSchedule.add('a1I540000008VtY');
                attendeeList1.add(cw1);

                }
   
        }
 
        public void addRow() {
                isRerender = true;
               
               CustomPackageWrapper cw = new CustomPackageWrapper(new Custom_Package__c());
               cw.rowIndex= c+1;
               
               c=c+1;
              
               
               
               attendeeList1.add(cw);


        }
        
       public void deleteLanguage() 
       {

        List<Custom_Package__c> langsToDelete = new List<Custom_Package__c>();
            for ( Integer i = 0; i < attendeeList1.size(); i++ ) {
        if ( attendeeList1[i].checked ) {
            langsToDelete.add(attendeeList1.remove(i--).cp);
        }
    }
    langsToDelete.clear();

       }
        

    public List<ID> discountScheduleID {
        get {
            if (discountScheduleID == null) {
                discountScheduleID = new List<ID>();
            }
            return discountScheduleID ;
        }
        set;
    }
    
      public List<SelectOption> getDept()
    {
        List<SelectOption> options = new List<SelectOption>();
        //options.add(new SelectOption('Select','--Select--'));
        
        for(Custom_Package__c Proj  :[select Id, Name from Custom_Package__c ] )
             {
                    system.debug('3333333'); 
                    options.add(new SelectOption(Proj.ID,Proj.Name));
                    
             }
        return options;
        
    }
 
   
   public Integer selectedRowIdx {get; set;}
   Public List<CustomPackageWrapper> cplist = new List<CustomPackageWrapper>();
   public CustomPackageWrapper cp2 = new CustomPackageWrapper (new Custom_Package__c() ); 
   Public List<CustomPackageWrapper> WrapperList{get;set;}
        
    
  public List<SelectOption> getMarket(){
            //system.debug('^^^^^^^^ Entered' +cp.discountSchedule );
                List<SelectOption> options = new List<SelectOption>();
                //cp.discountSchedule = new List<ID>();
               integer d=0;
             for(Custom_Package__c Proj1  :[select Id,Market__c from Custom_Package__c where ID IN:attendeeList1[d].discountSchedule and ID Not in :attendeeList1[c].discountSchedule ] )
                    {                    
                       // system.debug('3333333' + cp.discountSchedule ); 
                       // CustomPackageWrapper cp = new CustomPackageWrapper (new Custom_Package__c());
                       //  cp.discountSchedule.add(Proj1.Market__c );
                       //  cplist.add(cp );
                        options.add(new SelectOption(Proj1.ID,Proj1.Market__c ));
                        
                    }
                  
            //system.debug('^^^^^^^^ Entered' + options.size());        
            return options;
            

        }
    
    public string selectedMarketIds {get; set;}  
    
        public void FindAllName()
    {
        AllName= new List<SelectOption>();
        AllDept= new List<SelectOption>();
        system.debug('!!!!!!! Entered');
        
        
        AllName = getMarket();
        Alldept = getDept();
        system.debug('&&&&&&& Entered' + AllName );

    }
    
    public List<Custom_Package__c> editList   {get;set;}
    
    public void initList(){
          
        editList = [SELECT Name,
                           Market__c,
                           State__c,
                           First_Issue__c,
                           Last_Issue__c,
                           Circulation__c,
                           Space_Unit__c ,
                           Space_Discount__c,
                           Per_Unit_Open_Rate__c
                           FROM Custom_Package__c
                           ];
                           
        for(Custom_package__c c : editList){
            attendeeList1.add(new CustomPackageWrapper(c));
             
        }       
          
        }

    
    public List<CustomPackageWrapper> attendeeList1 {
        get {if (attendeeList1 == null)
             attendeeList1 = new List<CustomPackageWrapper>();
             return attendeeList1;
       }
        set;
        }



        public class CustomPackageWrapper {
        public Custom_Package__c cp {get; set;}
        public Integer rowIndex {get;set;}
        public List<ID> discountSchedule {
        get {
            if (discountSchedule == null) {
                discountSchedule = new List<ID>();
            }
            return discountSchedule ;
        }
        set;
        }
        
        public List<SelectOption> marketOptions {
        get {
            if (marketOptions == null) {
                marketOptions = new List<SelectOption>();
            }
            return marketOptions ;
        }
        set;
        }
        
        public List<String> stateOptions {
        get {
            if (stateOptions == null) {
                stateOptions = new List<String>();
            }
            return stateOptions ;
        }
        set;
        }
        
    public boolean checked {get; set;}
    
    public void updateMarketOptions() {
        marketOptions.clear();
        
        for (Custom_Package__c cp1 : [select Id, Market__c, state__c from Custom_Package__c where Id in :discountSchedule order by Market__c ]) {
            marketOptions.add(new SelectOption(cp1.Id, cp1.Market__c));
        }
        }

        public string discountSchedule1 {get;set;} 
        

        public string state{get; set;}

        public CustomPackageWrapper(Custom_Package__c cp) {
        this.cp = cp;
        this.checked = false;
        }

        }

}

 
srlawr uksrlawr uk
To save us trawling through the code line by line, could you possibly explain a bit more "what" the error you are getting is? A screenshot of the output and why it is wrong would be useful, or perhaps any error messages you are getting when actions are performed?

Scrolling through the code indicates a number of possibilities.

My first reaction was possibly field level security tbf...!
Mathew Andresen 5Mathew Andresen 5
Have you tried inputtext vs inputfield?
❤Code❤Code
Hi All,

From the below code I am able to get Market column details upon selecting custom package - 
 
<apex:actionSupport event="onchange" action="{!acc.updateMarketOptions}" rerender="geographies"  oncomplete="renderChosen()"/>

But I am not able to get rest of the column details. How can i display rest of the fields on the vf page. Is it possible from the below method soql query.
 
public void updateMarketOptions() {
        marketOptions.clear();
        
        for (Custom_Package__c cp1 : [select Id, Market__c, state__c from Custom_Package__c where Id in :discountSchedule order by Market__c ]) {
            marketOptions.add(new SelectOption(cp1.Id, cp1.Market__c));
        }
        }

        public string discountSchedule1 {get;set;} 
        

        public string state{get; set;}

        public CustomPackageWrapper(Custom_Package__c cp) {
        this.cp = cp;
        this.checked = false;
        }