I'm at a loss. I'm updating a List via checkbox/actionsupport method and it's saving one variable but not the other. (screenshot).
Here's code:
public class aAccount {
public Account act {get;set;}
public Boolean selected {get;set;}
public Double confidencescore {get;set;}
public aAccount(Account a) {
act = a;
selected = false;
confidencescore = 0;
}
}
Public List<aAccount> MatchingProperties {get; set;}
Public myController() { // initialize
MatchingProperties = New List<aAccount>(); }
public PageReference UpdatePropSelectedbyCheckbox(){
PropID=ApexPages.currentPage().getParameters().get('ID');
for (aAccount A:MatchingProperties){
if (A.act.Id==PropID) {
a.confidencescore=100;
}
}
return null;
}
VF:
<apex:pageblocktable var="properties" value="{!MatchingProperties}" id="pb">
<apex:inputCheckbox id="go" value="{!properties.selected}">
<Apex:actionsupport action="{!UpdatePropSelectedbyCheckbox}" event="onchange" rerender="asd">
<apex:param name="ID" value="{!properties.act.id}" assignto="{!PropID}"/>
</Apex:actionsupport>
</apex:inputCheckbox>
If you notice the breakpoint log, there's 2 records I checked off, the most recent being item #17. The checkbox values (selected) and confidence level both show all good, but upon exit, "selected" reverts to false while keeping the newly updated confidencescore at 100. Weird huh? Any ideas on how to update the List differently? Do I need to save the selected and confidence fields into a cloned list? I dunno. I'm new to Apex so I don't know much about its memory management..