Код Visualforce Page
Appointment Table
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection>
Select a doctor:
<apex:selectList size="1" multiselect="false" >
<apex:selectOptions id="selectedDoctor" value="{!doctorSelectOptionList}"/>
</apex:selectList>
</apex:pageBlockSection>
<apex:pageBlockSection id="startWork" >
Working House Start:
</apex:pageBlockSection>
<apex:pageBlockSection id="endWork">
Working House End:
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock>
Select a patient:
<apex:selectList size="1" multiselect="false">
<apex:selectOptions value="{!patientSelectOptionList}"/>
</apex:selectList>
</apex:pageBlock>
</apex:form>
Код Контроллера
public class ApexContr {
public List<Doctor__c> DoctorList {get;set;}
public List<SelectOption> doctorSelectOptionList {get;set;}
public List<Patient__c> PatientList {get;set;}
public List<SelectOption> patientSelectOptionList {get;set;}
public List<Doctor__c> endTime{get; set;}
public ApexContr (){
doctorSelectOptionList = new List<SelectOption>();
patientSelectOptionList = new List<SelectOption>();
DoctorList = [SELECT iD, Name FROM Doctor__c];
for (Doctor__c doc : DoctorList){
doctorSelectOptionList.add(new SelectOption(doc.Id, doc.Name));
}
PatientList = [SELECT Id, Name FROM Patient__c];
for (Patient__c patient : PatientList){
patientSelectOptionList.add(new SelectOption(patient.Id, patient.Name));
}
endTime = [SELECT Working_Hours_End__c FROM Doctor__c];
}
}