0

Not able to rerender objects on a Visualforce component's object. Have not had to rerender a component and have seen several variations on what I am trying to do.

The reRender="NSA1a,NSA1b,NSA1c" produces this error on the paretn Visualforce page:

ERROR: Could not resolve field 'Comment_diligence_coverage_investigation__c' from <apex:inputField> value binding '{!LOB.Comment_diligence_coverage_investigation__c}' in component c:prod_ccra_lob_nonstdauto   

On the parent Viualforce page:

<c:PROD_CCRA_LOB_NonStdAuto NonStdAuto="{!LOB_NonStdAuto}" record="{!Claims_Client_Risk_Assessment__c}" />

The Visualforce Component page:

<apex:pageBlockSectionItem dataStyleClass="col"  >
  <apex:outputLabel value="Does Client perform adequate investigations to confirm coverage for driver and vehicle at issue?"  StyleClass="col1"   />
    <apex:actionRegion >                          
      <apex:inputField value="{!NonStdAuto.Client_perform_adequate_investigation__c}" styleClass="col2" > 
      <apex:actionSupport event="onchange" reRender="NSA1a,NSA1b,NSA1c" / >                    
      </apex:inputField>
      </apex:actionRegion>
</apex:pageBlockSectionItem> 

<apex:pageBlockSectionItem dataStyleClass="col"  >                         
  <apex:outputLabel value=""   /> 
</apex:pageBlockSectionItem> 

<apex:pageBlockSectionItem dataStyleClass="col"  >
 <apex:outputPanel id="NSA1a">
    <apex:outputLabel value="Please comment as needed to describe the diligence of their coverage investigation:"  StyleClass="col4" rendered="{!IF(CONTAINS(NonStdAuto.Client_perform_adequate_investigation__c,'Yes'),true,false)}"   /> 

 </apex:outputPanel> 

 <apex:outputPanel id="NSA1b">                       
   <apex:inputField value="{!NonStdAuto.Comment_diligence_coverage_investigation__c}" styleClass="inputFieldStyle1" rendered="{!IF(CONTAINS(NonStdAuto.Client_perform_adequate_investigation__c,'Yes'),true,false)}"  />                  
 </apex:outputPanel>                                
</apex:pageBlockSectionItem> 

<apex:pageBlockSectionItem dataStyleClass="col"  >
  <apex:outputPanel id="NSA1c">                                               
    <apex:outputLabel value=""  rendered="{!IF(CONTAINS(NonStdAuto.Client_perform_adequate_investigation__c,'Yes'),true,false)}"  />                                                
 </apex:outputPanel>                                    
</apex:pageBlockSectionItem>

1 Answer 1

2

The variable is not set because you're rendering only part of the component. To make your life less complicated, just change all of the LOB to NonStdAuto.

5
  • Changed references to LOB to NonStdAuto. Error is gone but now that fields do not render on .
    – rickmac
    Jul 16, 2018 at 17:58
  • @rickmac It might be During the original render or after reRender?
    – sfdcfox
    Jul 16, 2018 at 18:06
  • looks like the original rendering because when I just open the parent page the field is set to "Yes" and the expected field below is not rendered.
    – rickmac
    Jul 16, 2018 at 19:13
  • @rickmac it's just an apex:outputLabel with no value. There would be nothing to see...
    – sfdcfox
    Jul 16, 2018 at 19:46
  • the outputLabel contains input fields as well. I got this to work using this rendering syntax: rendered="{!IF(CONTAINS(NonStdAuto.Client_perform_adequate_investigation__c,'Yes'),true,false)}" Your initial suggestion re: variable state helped out as I'm using the attribute (NonStdAuto) and not the variable assignment (LOB.) I prefer a shorter rendering statement but it wasn't evaluating to a true/false. Updating the source code above.
    – rickmac
    Jul 16, 2018 at 21:05

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.