I have a controller class, below.
It is passed in "thePpt" as an SOBJECT, and the class has access to it in the getGuam method, but not the initPhoneList or GetDaytimePhoneList() methods. WHY?
They return an Apex object, not a String? I'm guessing that I am in the wrong namespace or something. Please help!
public with sharing class FFGEHeader {
public Participant__c thePpt {get; set{ thePpt=value;}}
public String daytimePhone {get;set;}
public String altPhone {get;set;}
public String guam {set;}
public String getGuam()
{
if (thePpt != null)
return 'Guam';
else
return 'NULL PPT';
}
public Component.Apex.SelectList initPhoneList()
{
System.Debug('*** initPhoneList. Trying to see ppt object ***');
Component.Apex.SelectList selPhoneList = new Component.Apex.SelectList(id = daytimePhone , multiselect = false, size = 1, style = 'width:200px;');
if (thePpt != null)
{
if (thePpt.Home_Phone__c != null)
AddSelectOption(selPhoneList, 'Home Phone',thePpt.Home_Phone__c);
if (thePpt.Cell_Phone__c != null)
AddSelectOption(selPhoneList, 'Cell Phone',thePpt.Cell_Phone__c);
if (thePpt.Work_Phone__c != null)
AddSelectOption(selPhoneList, 'Work Phone',thePpt.Work_Phone__c);
} else
System.Debug('*** the PPT OBJECT IS NULL. WHY?????????? ***');
return selPhoneList;
}
public Component.Apex.PageBlockSectionItem GetDaytimePhoneList()
{
System.Debug('*** GetDaytimePhoneList ***');
Component.Apex.SelectList selPhoneList = this.initPhoneList();
Component.Apex.PageBlockSectionItem dayPhoneList = new Component.Apex.PageBlockSectionItem();
//Component.Apex.SelectList selPhoneList = new Component.Apex.SelectList(id = daytimePhone , multiselect = false, size = 1, style = 'width:200px;');
selPhoneList.expressions.value='{!daytimePhone}';
/*if (myPpt.Home_Phone__c != null)
AddSelectOption(selPhoneList, 'Home Phone',thePpt.Home_Phone__c);
if (myPpt.Cell_Phone__c != null)
AddSelectOption(selPhoneList, 'Cell Phone',thePpt.Cell_Phone__c);
if (thePpt.Work_Phone__c != null)
AddSelectOption(selPhoneList, 'Work Phone',thePpt.Work_Phone__c);
*/
/*if (myPpt != null)
{
AddSelectOption(selPhoneList,'Home Phone','3037795645');
AddSelectOption(selPhoneList,'Cell Phone','7207793211');
AddSelectOption(selPhoneList,'Work Phone','3037795645');
} */
dayPhoneList.childComponents.add(selPhoneList);
return dayPhoneList;
}