I have the following visualforce page:
<apex:page title="Select return address" Controller="FedExController">
<apex:form >
<apex:pageBlock title="FedEx Label generation for {!RMA}">
<span>Viable addresses: </span>
<apex:selectList size="1" id="returnAddressesSelectList" value="{!returnAddressesValue}">
<apex:actionSupport event="onchange" action="{!recalculateDefaults}" rerender="form"/>
<apex:selectOptions value="{!returnAddresses}" />
</apex:selectList><br></br>
<apex:inputText value="{!Address}" id="AddressTextBox"/>
</apex:pageBlock>
</apex:form>
</apex:page>
And the following controller:
global class FedExController {
private final Account account;
global static Id myIdclone;
public List<SelectOption> compressedAddressesPREFIX = new List<SelectOption>();
global string returnAddressesValue{get;set;}
public static string getDefaultSubject(){
return null;
}
public static string getRMA(){
Id myId = ApexPages.currentPage().getParameters().get('id');
System.debug('ID: ' + myId);
FedExLabelMethods job = new FedExLabelMethods();
String rmaNumber = FedExLabelMethods.getRMA(myId);
return rmaNumber;
}
public List<SelectOption> returnAddresses{
get{
Id myId = ApexPages.currentPage().getParameters().get('id');
FedExLabelMethods job = new FedExLabelMethods();
List<String> compressedAddresses = FedExLabelMethods.getlistofAddresses(myId);
for (integer i = 0; i < compressedAddresses.size(); i++){
string temporarystring = compressedAddresses[i];
string[] temporaryarray = temporarystring.split(',');
compressedAddressesPREFIX.add(new SelectOption(temporaryarray[0],temporaryarray[0]));
}
return compressedAddressesPREFIX;
}
set;
}
public static void recalculateDefaults(){
}
public string Address{
get{
system.debug('ReturnAddresses ' + returnAddressesValue);
system.debug('compressedAddressesPREFIX ' + compressedAddressesPREFIX);
return returnAddressesValue;
}
set;
}
}
What I am trying to do is probably extremely simple for others more experienced with visualforce than me. I want to get
System.debug('ReturnAddresses ' + returnAddressesvalue);
at the bottom of the visualforce controller to display the current value of the selected list id returnAddressesSelectList.
Currently the debug displays Null...
apex:commandButton
?