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

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

1 Answer 1

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.

8
  • Hi , even both are true, output field is not showing and instead the inputfield inside actionregion is being shown Commented Jul 7, 2015 at 11:36
  • I just need the same functionality as it is working for inputcheckbox Coach. Please find the image attached. Commented Jul 7, 2015 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.. Commented Jul 7, 2015 at 11:51
  • Constructor shows perfect result since it updates clearly , but page retains previous value. Commented Jul 7, 2015 at 12:01
  • Please chech your reset method by putting debug log is it showing expected value...... Commented Jul 7, 2015 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .