0

I have below render condition on below snippet that makes output field show on apex page when a particular checkbox is true for a list record. It is not working when that checkbox is checked from a command button, but works fine when I use input field for that checkbox.

Apex page code:

<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 value="{!itr.Confirm_Attestation_abv__c}" onchange="jsCoachSave('{!itr.Id}','{!itr.Confirm_Attestation_abv__c}');" />

                    <apex:inputField label="Transaction Type" value="{!itr.Recordtype.name}" style="display:none;"/>
                            </apex:actionRegion>
                              <apex:commandButton value="Coach"  onclick="jsCoachSave('{!itr.Id}','{!itr.Confirm_Attestation_abv__c}');" action="{!reset}" />
                    </apex:column>

Clicking on Coach command button not hiding the below Outcome input field.

<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 value="{!itr.Outcome_abv__c}" onchange="jsCallSave('{!itr.Id}','{!itr.Recordtype.name}','{!itr.Confirm_Attestation_abv__c }');"  rendered="{!itr.Confirm_Attestation_abv__c == false || checkbutton==false}">
                                    </apex:inputField>                                    
                                    <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 || checkbutton==true}"/>
                            </apex:column>

Please note I have checked 'checkbutton' bollean value to true when Coach method is called. Can someone please let me know the issue?

enter image description here

  • In your code you didn't mentioned any output Field.... You use rendered attribute only for img tag. – Amit Chaudhary Jul 7 '15 at 10:57
1

Make sure for hiding Outcome_abv__c field, itr.Confirm_Attestation_abv__c and checkbutton variable should be false because in inputfield you are using OR condition for showing this input field:

itr.Confirm_Attestation_abv__c == true || checkbutton==true

if one of these condition true it will show inputfield.

  • Hi , even both are true, output field is not showing and instead the inputfield inside actionregion is being shown – Testing_SFDC Jul 7 '15 at 11:36
  • I just need the same functionality as it is working for inputcheckbox Coach. Please find the image attached. – Testing_SFDC Jul 7 '15 at 11:38
  • Do one thing put system.debug(itr.Confirm_Attestation_abv__c) and system.debug(checkbutton) in reset method and check value in log after clicking command button. ------- And if your onclick="jsCoachSave" calling some save method, than may be this reset your variable value... what is the value of these variable in constructor.....? check this way.. – Amit Chaudhary Jul 7 '15 at 11:51
  • Constructor shows perfect result since it updates clearly , but page retains previous value. – Testing_SFDC Jul 7 '15 at 12:01
  • Please chech your reset method by putting debug log is it showing expected value...... – Amit Chaudhary Jul 7 '15 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.