I am facing a problem, i want to update an output field when an lookup field get changed, so i used an actionSupport with a param tag. in order to do so, i send a parameter to apex class to retrieve the appropriate name to be displayed (of course a method get executed in the controller).
The problem is that the first change is not detected meaning that the value sent to the controller is null, only after that (starting from the second change) that the field get updated here is the code:
<apex:InputField value="{!mission.remplace1__c}" id="Remplace1" >
<apex:actionSupport event="onchange" rerender="remplacement,accroissement,buttonBlock" action="{!AfficherRemplacant}" >
<apex:param name="personneID" assignto="{!missionPersonne}" value="{!mission.remplace1__c}"/>
</apex:actionSupport>
</apex:InputField>
here is the field to be updated :
<apex:OUTPUTField value="{!listHabilitation[0].poste__r.name}" rendered="{!flag4}">
and finally the apex method executed:
public pagereference AfficherRemplacant(){
system.debug('Le ID transmet est = '+missionPersonne);
listHabilitation = [select id,poste__r.name from habilitation__c where personne__c =:missionPersonne limit 1];
if(listHabilitation.size() > 0){
flag4 =true;
}
return null;
}
any ideas or workarounds ?