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
Sainath VenkatSainath Venkat 

uncheck checkbox if other is checked in Visualforce

Hello Guys,

I am working on one vf Page where I have two check boxes for each row, so if I check one checkbox then other should be unchecked.
I mean in one row,I can select only one check.

User-added image
In above screenshot if I select approved then disapproved should get unchecked and vice versa.

My vf page code is below.
<apex:page controller="ApproveTimeSheetController" lightningStylesheets="true">
   
   
    <style type="text/css">
       
        .inputcell {width:80px;text-align:center;}
        
        .myFormStyle {
            background-color:#7492B1;
        }
        
        
         
        #customers {
          font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
          border-collapse: collapse;
          width: 100%;
        } 
        
        #customers td, #customers th {
          border: 1px solid #ddd;
          padding: 4px;
        }
        
        #customers tr:nth-child(even){background-color: #eaebef;}
        #customers tr {
            height: 40px;
        }
        #customers tr:hover {background-color: #ddd;}
        
        #customers th {
          padding-top: 5px;
          padding-bottom: 5px;        
          background-color: #a9c2d6;
          color: white;
        }

    
    </style>
   
  
    <apex:form id="timesheetform" styleclass="myFormStyle" rendered="{!!PageInError}">
        
      
        <apex:slds />
            
        <div style="padding: 20px;" >
        
          
            <div class="slds-page-header">
                <div class="slds-page-header__row">
                    
                    <div class="slds-page-header__col-title">
                        <div class="slds-media">
                            <div class="slds-media__figure">
                                <span class="slds-icon_container slds-icon-standard-opportunity" title="Approve Timesheet">
                                    <svg class="slds-icon slds-page-header__icon" aria-hidden="true">
                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#work_type_group" />
                                    </svg>
                                    <span class="slds-assistive-text">Forecast</span>
                                </span>
                            </div>
                        <div class="slds-media__body">
                            <div class="slds-page-header__name">
                                <div class="slds-page-header__name-title">
                                    <h1><span class="slds-page-header__title slds-truncate">{!Title}</span></h1>
                                </div>
                            </div>
                            <p class="slds-page-header__name-meta">Approve Timesheets</p>
                        </div>
                        <br/>
                         <a href="/{!ParameterId}">Back to Project</a>
                    </div>
                </div>
                </div>
            </div>
    
            <br/>
           
            <apex:pageBlock title="Date Selection" id="DateSelection">
            
                <table width="100%">
                    <COLGROUP width="40%"></COLGROUP>
                    <COLGROUP width="40%"></COLGROUP>
                
                    <tr>
                        <td><apex:outputLabel value="Week Start" />&nbsp;&nbsp;<apex:inputField value="{!fakeWeek1.Week_Start_Date__c}" /></td>
                        <td ><apex:commandButton action="{!Previous}" value="<<"/>&nbsp;&nbsp;<apex:commandButton value="Refresh" action="{!Refresh}"/> &nbsp;&nbsp;<apex:commandButton action="{!Next}" value=">>" /></td>
                     
                        
                    </tr>
                </table>
            </apex:pageBlock>
             
            <br/>
            
            <apex:repeat value="{!TimeSheetsByMembers}" var="member">
                <apex:pagemessages id="ErrorMessages" />  
                <apex:pageBlock title="{!member.TeamMemberName} ({!member.Role})">
                    <apex:outputpanel rendered="{!member.NoTimeThisWeek}">
                       <div style="color:red;"><b>NO TIMESHEET ENTRIES FOR THIS WEEK</b></div>
                    </apex:outputpanel>
                    <apex:outputpanel id="Timesheets" rendered="{!not(member.NoTimeThisWeek)}">
                        <table padding="30px;">
                            <tr><td  style="text-align:right;">  
                        
                                <apex:commandButton value="Approve All" action="{!ApproveAll}" rerender="timesheetform">
                                    <apex:param name="index" value="{!member.TeamMemberid}" assignTo="{!SelectedMemberId}"/>
                                </apex:commandButton>
                            </td></tr>
                        </table>
                        <br/>
                        <table padding="10px;" id="customers">
                            <COLGROUP width="7%"></COLGROUP>
                            <COLGROUP width="12%"></COLGROUP>    
                            <COLGROUP width="12%"></COLGROUP>    
                            <COLGROUP width="7%"></COLGROUP> 
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="20%"></COLGROUP>
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="20%"></COLGROUP>
                            <COLGROUP width="15%"></COLGROUP>
                            
                            <!--headers-->
                           
                            <tr class="dbrow">
                                <th>Date</th>
                                <th style="text-align:center;">Function</th>
                                <th style="text-align:center;">Type of Work</th>
                                <th style="text-align:center;">Hours</th>
                                <th style="text-align:center;">Billable</th>
                                <th>Comments</th> 
                                <th style="text-align:center;">Approved</th>
                                <th style="text-align:center;">Rejected</th>
                                <th>Rejected Comments</th>
                                <th>Click to Edit</th>
                            </tr>    
                            <apex:repeat value="{!member.Times}" var="time"> 
                                <tr>
                                    <td><apex:outputText value="{!time.TimeDate}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Function__c}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Type_of_Work__c}"/></td> 
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Hours__c}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Billable__c}"/></td>
                                    <td><apex:outputText value="{!time.timerecord.Comments__c}"/></td>   
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox id="apprvchk" value="{!time.Approved}">
                                        
                                        </apex:inputcheckbox> 
                                            
                                    </td>  
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox id="rejectchk" value="{!time.Rejected}">
                                            
                                        </apex:inputCheckbox>
                                    </td>  
                                    <td><apex:inputText value="{!time.timerecord.Rejected_Comments__c}"/></td>  
                                    <td><apex:outputlink value="/{!time.timerecord.Id}" target="_blank">{!time.timerecord.name}</apex:outputlink></td>  
                                </tr>
                              
                            </apex:repeat>
                           
                        </table>
                        <br/>
                         <table padding="30px;">
                            
                            <tr><td style="text-align:right;">
                                <apex:actionStatus id="submitstatus">
                                    <apex:facet name="start"> 
                                         <img style="opacity:1.0;" src="{!$Resource.SavingGif}"/>
                                    </apex:facet>
                                </apex:actionStatus>   
                                &nbsp;&nbsp;
                                <apex:commandButton value="Submit" action="{!SaveCheckboxes}" rerender="Timesheets,ErrorMessages" status="submitstatus">
                                      <apex:param name="index2" value="{!member.TeamMemberid}" assignTo="{!SelectedMemberId}"/>
                                </apex:commandButton>
                            </td></tr>
                        </table>
                    </apex:outputpanel>
                </apex:pageBlock>        
                
                
            </apex:repeat>
            
         
        </div>
        
    </apex:form> 
</apex:page>
Can anyone help me out in this issue if possible please.
 
Umesh RathiUmesh Rathi
Hi, Please go through below code.
Add Action on click of the checkbox using actionSupport and you can create methods in controller to disable /enable Approved/Rejected Checkboxes.
<apex:repeat value="{!TimeSheetsByMembers}" var="member">
                <apex:pagemessages id="ErrorMessages" />  
                <apex:pageBlock title="{!member.TeamMemberName} ({!member.Role})" id="theBlock">
                    <apex:outputpanel rendered="{!member.NoTimeThisWeek}">
                       <div style="color:red;"><b>NO TIMESHEET ENTRIES FOR THIS WEEK</b></div>
                    </apex:outputpanel>
                    <apex:outputpanel id="Timesheets" rendered="{!not(member.NoTimeThisWeek)}">
                        <table padding="30px;">
                            <tr><td  style="text-align:right;">  
                        
                                <apex:commandButton value="Approve All" action="{!ApproveAll}" rerender="timesheetform">
                                    <apex:param name="index" value="{!member.TeamMemberid}" assignTo="{!SelectedMemberId}"/>
                                </apex:commandButton>
                            </td></tr>
                        </table>
                        <br/>
                        <table padding="10px;" id="customers">
                            <COLGROUP width="7%"></COLGROUP>
                            <COLGROUP width="12%"></COLGROUP>    
                            <COLGROUP width="12%"></COLGROUP>    
                            <COLGROUP width="7%"></COLGROUP> 
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="20%"></COLGROUP>
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="20%"></COLGROUP>
                            <COLGROUP width="15%"></COLGROUP>
                            
                            <!--headers-->
                           
                            <tr class="dbrow">
                                <th>Date</th>
                                <th style="text-align:center;">Function</th>
                                <th style="text-align:center;">Type of Work</th>
                                <th style="text-align:center;">Hours</th>
                                <th style="text-align:center;">Billable</th>
                                <th>Comments</th> 
                                <th style="text-align:center;">Approved</th>
                                <th style="text-align:center;">Rejected</th>
                                <th>Rejected Comments</th>
                                <th>Click to Edit</th>
                            </tr>    
                            <apex:repeat value="{!member.Times}" var="time"> 
                                <tr>
                                    <td><apex:outputText value="{!time.TimeDate}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Function__c}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Type_of_Work__c}"/></td> 
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Hours__c}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Billable__c}"/></td>
                                    <td><apex:outputText value="{!time.timerecord.Comments__c}"/></td>   
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox id="apprvchk" value="{!time.Approved}">
                                        <apex:actionSupport event="onclick" action="{!uncheckRejected}" rerender="theBlock"></apex:actionSupport>
                                        </apex:inputcheckbox> 
                                            
                                    </td>  
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox id="rejectchk" value="{!time.Rejected}">
                                            apex:actionSupport event="onclick" action="{!uncheckApproved}" rerender="theBlock"></apex:actionSupport>
                                        </apex:inputCheckbox>
                                    </td>  
                                    <td><apex:inputText value="{!time.timerecord.Rejected_Comments__c}"/></td>  
                                    <td><apex:outputlink value="/{!time.timerecord.Id}" target="_blank">{!time.timerecord.name}</apex:outputlink></td>  
                                </tr>
                              
                            </apex:repeat>
Hope it Helps!
Thanks!
Sainath VenkatSainath Venkat
Hi Umesh,
Thanks a lot for your time and replying me.
I have updated the code which you have provided but its not working.
I mean check box is not geeting uncheck.
Can you please help me out here.
Umesh RathiUmesh Rathi
Hi Sainath,
Did you add controller method to check uncheck the checkboxes?
Please go through below modifications and let me know the Progress. You might need to change some things as per your requirement.
 
<td style="text-align:center;">
                                        <apex:inputcheckbox  selected = "{!isApproved}" id="apprvchk" value="{!time.Approved}">
                                        <apex:actionSupport event="onclick" action="{!uncheckRejected}" rerender="theBlock"></apex:actionSupport>
                                        </apex:inputcheckbox> 
                                            
                                    </td>  
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox selected = "{!isRejected}" id="rejectchk" value="{!time.Rejected}">
                                            apex:actionSupport event="onclick" action="{!uncheckApproved}" rerender="theBlock"></apex:actionSupport>
                                        </apex:inputCheckbox>
                                    </td> 

Controller:

Public class classname{
public boolean isApproved {get;set;}
public boolean isRejected {get;set;}
 public classname(){
	isApproved = false;
	isRejected = false;
}
 public void uncheckRejected(){
	isApproved = true;
	isRejected = false;
}

 public void uncheckApproved(){
	isApproved = false;
	isRejected = true;
}
}

Thanks!
Please mark it as best answer if it solves the issue.
Sainath VenkatSainath Venkat
Hello Umesh,

I did updated my controller and vf page but still its not working.
My controller is below.
public class ApproveTimeSheetController {
    
  
    public string ParameterId {get;set;}

     
    public Project__c currentProject {get;set;}
  
    public boolean PageInError {get;set;}
    
    public string Title {get;set;}
    
    public string SelectedMemberId {get; set;}  
    public string SelectedTimeSheetId {get; set;} 

    //Contructor
    public ApproveTimeSheetController() {
        
        PageInError=false;
        
        ParameterId=ApexPages.currentPage().getParameters().get('Id');
        
        system.debug('++parameterID  :' + parameterID);
        
        //Check if we have a SOW or a project, then deduce the parent sow or child project.
        
        if (parameterID!=null){
        
            for (Project__c p:[select name,Sow__c from Project__c where id=:parameterID])
                currentProject=p;
            Title='Project: ' + currentProject.name;
        }
        
        if (currentProject == null){
            pageInError=true;
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Project or SOW not found'));
        }
      
        
    }



    public Forecast__c fakeWeek1 {
        get {
            if (fakeWeek1 == null) {
                fakeWeek1 = new Forecast__c();
                fakeWeek1.Week_Start_Date__c = System.today().toStartOfWeek();
                fakeWeek1.Week_End_Date__c = fakeWeek1.Week_Start_Date__c.addDays(6);
            }
            return fakeWeek1;
        }
        set;
    }
    
    public pageReference UncheckApproved(){
        for (TimeSheetsByMember m:TimeSheetsByMembers){
            if (m.TeamMemberId==SelectedMemberId){
                for (Time2 t:m.Times){
                    if (t.timerecord.id==SelectedTimeSheetId){
                        if (t.Rejected==true)
                            t.Approved=false;
                        break;
                    }
                }
                break;
            }
        }
        return null;    
    }
    
    public pageReference UncheckRejected(){
        for (TimeSheetsByMember m:TimeSheetsByMembers){
            if (m.TeamMemberId==SelectedMemberId){
                for (Time2 t:m.Times){
                    if (t.timerecord.id==SelectedTimeSheetId){
                        if (t.Approved==true)
                            t.Rejected=false;
                        break;
                    }
                }
                break;
            }
        }
        return null;
    }
    
    
    public pageReference ApproveAll(){
        //Find the proper project member in the list based on selectedMemberId
        system.assertNotEquals(SelectedMemberId,null);
        for (TimeSheetsByMember m:TimeSheetsByMembers){
            if (m.TeamMemberId==SelectedMemberId){
                for (Time2 t:m.Times){
                    t.Approved=true;
                    t.Rejected=false;
                }
                break;
            }
        }
        return null;
    } 
    
    public pagereference Next() {
        fakeWeek1.Week_Start_Date__c = fakeWeek1.Week_Start_Date__c.addDays(7);
        fakeWeek1.Week_End_Date__c =fakeWeek1.Week_End_Date__c.addDays(7);
        resetData();
        return null;
    }
    public pagereference Previous() {
         fakeWeek1.Week_Start_Date__c = fakeWeek1.Week_Start_Date__c.addDays(-7);
        fakeWeek1.Week_End_Date__c =fakeWeek1.Week_End_Date__c.addDays(-7);
         resetData();
        return null;   
    }
    
    public pageReference SaveCheckboxes(){
        
        list<Time__c> timeSheetsToUpdate = new list<Time__c>();
        for (TimeSheetsByMember m:TimeSheetsByMembers){
            if (m.TeamMemberId==SelectedMemberId){
                for (Time2 t:m.Times){
                    if (t.Approved && t.Rejected){
                         ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot approve and reject a record.'));
                    }
                    else if (t.Rejected)
                        t.timerecord.Approval_Status__c='Rejected';
                    else if (t.Approved)
                        t.timerecord.Approval_Status__c='Approved';
                    else
                        t.timerecord.Approval_Status__c='';
                        
                    timeSheetsToUpdate.add(t.timerecord);
                }
                break;
            }
        }
        update timeSheetsToUpdate;
      //   ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,'Your changes were saved.'));
        
        return null;
        return null;  
    }
    
    public list<Project_Team__c> ProjectMembers {
        get {
            if (ProjectMembers==null){
               
                if (currentProject!=null)
                    ProjectMembers= new list<Project_Team__c>([select Id,Team_Member__r.Name, Project_Role_Name__c ,Project_Role__r.Est_Hours__c from Project_Team__c where Project__c=:currentProject.id]);
                else
                    ProjectMembers=new list<Project_Team__c>();
            }
            return ProjectMembers;
        }
        private set;
    }
    
    public list<TimeSheetsByMember> TimeSheetsByMembers {
        get{
            if (TimeSheetsByMembers==null){
                
                
            
                //Fetch TimeSheets in that range and map by Project Team Member
                Map<Id,list<Time2>> MapTimeSheets = new Map<Id,list<Time2>>(); //Key: Project_Team_Role__c (ie: team member)
            
                for (Time__c t:[select Id, name,Date__c,Hours__c,Type_of_Work__c,Function__c,Comments__c,Rejected_Comments__c,Project_Team_Role__c,Billable__c,Approval_Status__c
                                FROM Time__c
                                WHERE Project_Team_Role__c in:ProjectMembers
                                AND Date__c >=:fakeWeek1.Week_Start_Date__c and Date__c<=:fakeWeek1.Week_Start_Date__c.addDays(6)
                                ORDER by Date__c]){
                
                    list<Time2> tmpList = MapTimeSheets.containsKey(t.Project_Team_Role__c)?MapTimeSheets.get(t.Project_Team_Role__c):new list<Time2>();
                    tmpList.add(new Time2(t));
                    MapTimeSheets.put(t.Project_Team_Role__c,tmpList);
                }
            
                list<TimeSheetsByMember> TimeSheetsByMembersUnordered = new list<TimeSheetsByMember>();
                
                for (Project_Team__c pm:ProjectMembers){
                    
                    TimeSheetsByMember tm=new TimeSheetsByMember();
                    tm.TeamMemberId=pm.id;
                    tm.TeamMemberName=pm.Team_Member__r.Name;
                    tm.Role=pm.Project_Role_Name__c;
                    if (MapTimeSheets.containsKey(pm.id)){
                        tm.Times=MapTimeSheets.get(pm.id);
                        tm.NoTimeThisWeek=false;
                    }
                    else{
                        tm.Times=new list<Time2>();
                        tm.NoTimeThisWeek=true;
                    }
                        
                    TimeSheetsByMembersUnordered.add(tm);    
                }
                
                //Reorder to put resource without times at the bottom
                TimeSheetsByMembers = new list<TimeSheetsByMember>();
                for (TimeSheetsByMember tm:TimeSheetsByMembersUnordered){
                    if (!tm.NoTimeThisWeek)
                        TimeSheetsByMembers.add(tm);
                }
                for (TimeSheetsByMember tm:TimeSheetsByMembersUnordered){
                    if (tm.NoTimeThisWeek)
                        TimeSheetsByMembers.add(tm);
                }
                
                
                
                
            }   
            return TimeSheetsByMembers;
        }
        private set;
    }
    
    
    private void resetData(){
        TimeSheetsByMembers=null;
        ProjectMembers=null;
        
    }
    
    public pageReference Refresh() {
        resetData();
        return null;    
    }
    
  
    
    public class TimeSheetsByMember {
        public Id TeamMemberId {get;private set;}
        public string TeamMemberName {get;private set;}
        public String Role {get;private set;}
        public integer totalHours {get;private set;}
        public list<Time__c> TimeSheets {get;set;}
        public list<Time2> Times {get;set;}
        public boolean NoTimeThisWeek {get;set;}
    }
    
    public class Time2 {
        public Time__c timerecord {get;set;}
        public string TimeDate {get;set;}
        public boolean Approved {get;set;}
        public boolean Rejected {get;set;}
        public boolean apprvchk {get;set;}
        public boolean rejectchk {get;set;}
        public Time2(Time__c timerec){
            this.timerecord=timerec;
            if (timerec.Approval_Status__c=='Approved')
                this.Approved=true;
            else if (timerec.Approval_Status__c=='Rejected')
                this.Rejected=true;
            this.TimeDate=String.ValueOf(timerecord.Date__c.day())+'/'+String.ValueOf(timerecord.Date__c.month())+'/'+String.ValueOf(timerecord.Date__c.year());  
        }
    }
Public class classname{
public boolean Approved {get;set;}
public boolean Rejected {get;set;}
 public classname(){
	Approved = false;
	Rejected = false;
}
 public void uncheckRejected(){
	Approved = true;
	Rejected = false;
}

 public void uncheckApproved(){
	Approved = false;
	Rejected = true;
}
}
  
  
      /* 
  
   public class ForecastRole {
        
        public string rolename {get;private set;}
        public Id roleId {get;private set;}
        public String Type {get;private set;}
        public decimal totalSowHours {get;private set;}
        public integer totalHours {get;private set;}
        public integer totalPlannedHours {get;private set;}
        public list<ForecastDate> ForecastDates {get;set;}
        //Constructor
        public ForecastRole(string rolename,Id roleId,decimal totalSowHours){
            this.rolename=rolename;
            this.roleId=roleId;
            this.totalSowHours= totalSowHours;
        }
    }
    
  public class ForecastMember {
        
        public Id TeamMemberId {get;private set;}
        public string TeamMemberName {get;private set;}
        public string rolename {get;private set;}
        public decimal totalSowHours {get;private set;}
        public integer totalHoursPlan {get;private set;}
        public integer totalHoursForecast {get;private set;}
        public integer totalHoursForecastAll {get;private set;}
        public list<ForecastDate> ForecastDates {get;set;}
        //Constructor
        public ForecastMember(String TeamMemberName,string rolename,Id TeamMemberId,decimal totalSowHours){
            this.TeamMemberName=TeamMemberName;
            this.rolename=rolename;
            this.TeamMemberId=TeamMemberId;
            this.totalSowHours= totalSowHours;
        }
    }
    
   
*/

}

My VF Page:
<apex:page controller="ApproveTimeSheetController" lightningStylesheets="true">
   
    <style type="text/css">
       
        .inputcell {width:80px;text-align:center;}
        
        .myFormStyle {
            background-color:#7492B1;
        }
        
        
         
        #customers {
          font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
          border-collapse: collapse;
          width: 100%;
        } 
        
        #customers td, #customers th {
          border: 1px solid #ddd;
          padding: 4px;
        }
        
        #customers tr:nth-child(even){background-color: #eaebef;}
        #customers tr {
            height: 40px;
        }
        #customers tr:hover {background-color: #ddd;}
        
        #customers th {
          padding-top: 5px;
          padding-bottom: 5px;        
          background-color: #a9c2d6;
          color: white;
        }

    
    </style>
   
  
    <apex:form id="timesheetform" styleclass="myFormStyle" rendered="{!!PageInError}">
<script>
window.onload = function confirmDisbaled(ifchecked, id1 ,id2) {
         document.getElementById(id1).disabled = ifchecked;
document.getElementById(id2).disabled = ifchecked;
      }  
function confirmDisbaled(ifchecked, id1 ,id2) {


document.getElementById(id1).disabled = ifchecked;
document.getElementById(id2).disabled = ifchecked;
}
</script>
      
        <apex:slds />
            
        <div style="padding: 20px;" >
        
          
            <div class="slds-page-header">
                <div class="slds-page-header__row">
                    
                    <div class="slds-page-header__col-title">
                        <div class="slds-media">
                            <div class="slds-media__figure">
                                <span class="slds-icon_container slds-icon-standard-opportunity" title="Approve Timesheet">
                                    <svg class="slds-icon slds-page-header__icon" aria-hidden="true">
                                        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#work_type_group" />
                                    </svg>
                                    <span class="slds-assistive-text">Forecast</span>
                                </span>
                            </div>
                        <div class="slds-media__body">
                            <div class="slds-page-header__name">
                                <div class="slds-page-header__name-title">
                                    <h1><span class="slds-page-header__title slds-truncate">{!Title}</span></h1>
                                </div>
                            </div>
                            <p class="slds-page-header__name-meta">Approve Timesheets</p>
                        </div>
                        <br/>
                         <a href="/{!ParameterId}">Back to Project</a>
                    </div>
                </div>
                </div>
            </div>
    
            <br/>
           
            <apex:pageBlock title="Date Selection" id="DateSelection">
            
                <table width="100%">
                    <COLGROUP width="40%"></COLGROUP>
                    <COLGROUP width="40%"></COLGROUP>
                
                    <tr>
                        <td><apex:outputLabel value="Week Start" />&nbsp;&nbsp;<apex:inputField value="{!fakeWeek1.Week_Start_Date__c}" /></td>
                        <td ><apex:commandButton action="{!Previous}" value="<<"/>&nbsp;&nbsp;<apex:commandButton value="Refresh" action="{!Refresh}"/> &nbsp;&nbsp;<apex:commandButton action="{!Next}" value=">>" /></td>
                     
                        
                    </tr>
                </table>
            </apex:pageBlock>
             
            <br/>
            
            <apex:repeat value="{!TimeSheetsByMembers}" var="member">
                <apex:pagemessages id="ErrorMessages" />  
                <apex:pageBlock title="{!member.TeamMemberName} ({!member.Role})">
                    <apex:outputpanel rendered="{!member.NoTimeThisWeek}">
                       <div style="color:red;"><b>NO TIMESHEET ENTRIES FOR THIS WEEK</b></div>
                    </apex:outputpanel>
                    <apex:outputpanel id="Timesheets" rendered="{!not(member.NoTimeThisWeek)}">
                        <table padding="30px;">
                            <tr><td  style="text-align:right;">  
                        
                                <apex:commandButton value="Approve All" action="{!ApproveAll}" rerender="timesheetform">
                                    <apex:param name="index" value="{!member.TeamMemberid}" assignTo="{!SelectedMemberId}"/>
                                </apex:commandButton>
                            </td></tr>
                        </table>
                        <br/>
                        <table padding="10px;" id="customers">
                            <COLGROUP width="7%"></COLGROUP>
                            <COLGROUP width="12%"></COLGROUP>    
                            <COLGROUP width="12%"></COLGROUP>    
                            <COLGROUP width="7%"></COLGROUP> 
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="20%"></COLGROUP>
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="5%"></COLGROUP>
                            <COLGROUP width="20%"></COLGROUP>
                            <COLGROUP width="15%"></COLGROUP>
                            
                            <!--headers-->
                           
                            <tr class="dbrow">
                                <th>Date</th>
                                <th style="text-align:center;">Function</th>
                                <th style="text-align:center;">Type of Work</th>
                                <th style="text-align:center;">Hours</th>
                                <th style="text-align:center;">Billable</th>
                                <th>Comments</th> 
                                <th style="text-align:center;">Approved</th>
                                <th style="text-align:center;">Rejected</th>
                                <th>Rejected Comments</th>
                                <th>Click to Edit</th>
                            </tr>    
                            <apex:repeat value="{!member.Times}" var="time"> 
                                <tr>
                                    <td><apex:outputText value="{!time.TimeDate}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Function__c}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Type_of_Work__c}"/></td> 
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Hours__c}"/></td>
                                    <td style="text-align:center;"><apex:outputText value="{!time.timerecord.Billable__c}"/></td>
                                    <td><apex:outputText value="{!time.timerecord.Comments__c}"/></td>   
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox id="apprvchk" value="{!time.Approved}">
                                        <apex:actionSupport event="onclick" action="{!uncheckRejected}" rerender="theBlock"></apex:actionSupport>
                                        </apex:inputcheckbox> 
                                            
                                    </td>  
                                    <td style="text-align:center;">
                                        <apex:inputcheckbox id="rejectchk" value="{!time.Rejected}">
                                        <apex:actionSupport event="onclick" action="{!uncheckApproved}" rerender="theBlock"></apex:actionSupport>   
                                        </apex:inputCheckbox>
                                    </td>  
                                    <td><apex:inputText value="{!time.timerecord.Rejected_Comments__c}" /></td>  
                                    <td><apex:outputlink value="/{!time.timerecord.Id}" target="_blank">{!time.timerecord.name}</apex:outputlink></td>  
                                </tr>
                              
                            </apex:repeat>
                           
                        </table>
                        <br/>
                         <table padding="30px;">
                            
                            <tr><td style="text-align:right;">
                                <apex:actionStatus id="submitstatus">
                                    <apex:facet name="start"> 
                                         <img style="opacity:1.0;" src="{!$Resource.SavingGif}"/>
                                    </apex:facet>
                                </apex:actionStatus>   
                                &nbsp;&nbsp;
                                <apex:commandButton value="Submit" action="{!SaveCheckboxes}" rerender="Timesheets,ErrorMessages" status="submitstatus">
                                      <apex:param name="index2" value="{!member.TeamMemberid}" assignTo="{!SelectedMemberId}"/>
                                </apex:commandButton>
                            </td></tr>
                        </table>
                    </apex:outputpanel>
                </apex:pageBlock>        
                
                
            </apex:repeat>
            
         
        </div>
        
    </apex:form> 
</apex:page>