I have below piece of code where click on Coach button needs to disable input field Outcome. I have placed that in below code which is not giving desired output. Can someone please let me know?
Apex Page:
<apex:tabPanel rerender="pms">
<apex:tab label="HCP Detail Calls" >
<apex:pageblockTable id="HCPDetail" value="{!oIncTranListHCPDetail}" var="itr" >
<apex:column headervalue="Coach">
<apex:actionRegion >
<apex:actionStatus id="SaveStatus_HCP_Detail">
<apex:facet name="start" >
<apex:outputText value="Saving...!" />
</apex:facet>
<apex:facet name="stop" >
<apex:image url="/img/msg_icons/confirm16.png" title="Saved Successfully" rendered="{!itr.Id == targetId}" />
</apex:facet>
</apex:actionstatus>
<apex:inputField id="out" value="{!itr.Confirm_Attestation_abv__c}" onchange="jsCoachSave('{!itr.Id}','{!itr.Confirm_Attestation_abv__c}');" />
<!-- <script>document.getElementById('{!$Component.out}').disabled = {!itr.Confirm_Attestation_abv__c}; </script> -->
<apex:inputField label="Transaction Type" value="{!itr.Recordtype.name}" style="display:none;"/>
<apex:commandButton id="chk" value="Coach" onclick="jsCoachSave('{!itr.Id}','{!itr.Confirm_Attestation_abv__c}');" action="{!reset}" rerender="none"/>
</apex:actionRegion>
</apex:column>
<apex:column headerValue="Incident ID ">
<apex:outputLink value="/{!itr.Id}">{!itr.Name}</apex:outputLink>
</apex:column>
<apex:column value="{!itr.Account_abv__c}"/>
<!-- <apex:column value="{!itr.Call_abv__c}"/> -->
<apex:column value="{!itr.Product_abv__c}"/>
<apex:column value="{!itr.Time_of_Event_ABS_abv__c}"/>
<apex:column value="{!itr.Audit_Reason_abv__c}"/>
<apex:column headerValue="Transaction Type" value="{!itr.Recordtype.name}"/>
<apex:column headerValue="Outcome" >
<apex:actionRegion >
<apex:actionStatus id="SaveStatus">
<apex:facet name="start" >
<apex:outputText value="Saving...!" />
</apex:facet>
<apex:facet name="stop" >
<apex:image url="/img/msg_icons/confirm16.png" title="Saved Successfully" rendered="{!itr.Id == targetId}" />
</apex:facet>
</apex:actionstatus>
<apex:inputField id="chk1" value="{!itr.Outcome_abv__c}" onchange="jsCallSave('{!itr.Id}','{!itr.Recordtype.name}');" rendered="{!itr.Confirm_Attestation_abv__c == false}">
</apex:inputField>
<script>document.getElementById('{!$Component.chk1}').disabled = {!itr.Confirm_Attestation_abv__c}; </script>
<apex:inputField label="Transaction Type" value="{!itr.Recordtype.name}" style="display:none;"/>
</apex:actionRegion>
<apex:outputField value="{!itr.Outcome_abv__c}" rendered="{!itr.Confirm_Attestation_abv__c == true}"/>
</apex:column>
</apex:pageblockTable>
</apex:tab>
</apex:tabPanel>
Please find jsCoachSave function here.
function jsCoachSave(citId,Attest){
document.getElementById('pg:fm:iTargetId').value = citId;
document.getElementById('pg:fm:iAttest').value = Attest;
CoachSave(citId,Attest); //
}
It calls apex function CoachSave as below.