1

I can't get the child objects in the section id="LOB_WC1a", "LOB_WC1aa","LOB_WC1bb" to render. These are child elements of the pageBlockSections that should render. Any ideas?

<apex:tab label="Workers Comp" name="tab1" id="tab1"  rendered="{!IF(CONTAINS(Account_Summary__c.Lines_of_Business__c,'WC'),"true","false")}" > 
<apex:outputPanel Style="width:100%;" layout="block">
            <apex:pageBlockSection id="LOB_WC1" title="My Content Section" columns="2" showHeader="false" >

                <apex:pageBlockSectionItem dataStyleClass="col" >
                    <apex:outputLabel value="Portfolio Hazard Group F&G Exposure" for="account__name" StyleClass="col1"  />
                        <apex:actionRegion >                    
                        <apex:inputField value="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c}" id="account__name" StyleClass="col2" >
                            <apex:actionSupport event="onchange" reRender="LOB_WC1a,LOB_WC1aa,LOB_WC1bb" / > 
                        </apex:inputField>
                        </apex:actionRegion>                        
                </apex:pageBlockSectionItem>

                    <apex:pageBlockSectionItem dataStyleClass="col"  >
                        <!-- <apex:outputLabel value="Comment 1" for="account__site" style="float: left;text-align: right;width:20px;color:blue;" /> --> 
                        <apex:inputField value="{!Account_Summary__c.WC1_Comment__c}" id="account__site" Style="width:100%;height: auto;float: left;text-align: left;color:purple"  /> 
                    </apex:pageBlockSectionItem> 

                <apex:pageBlockSectionItem dataStyleClass="col"  >
                    <apex:outputLabel id="LOB_WC1a" value="Comment on analysis of Exposure" for="account__name"  StyleClass="col1" rendered="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c='Yes'}" />
                    <apex:inputField id="LOB_WC1aa" value="{!Account_Summary__c.WC_Comment_on_analysis_of_exposure__c}" StyleClass="col2" rendered="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c='Yes'}"  /> 
                </apex:pageBlockSectionItem>

                    <apex:pageBlockSectionItem dataStyleClass="col" >
                        <!-- <apex:outputLabel id="LOB_WC1b" value="Comment 2" for="account__site" style="float: left;text-align: right;width:20px;color:blue;" rendered="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c='Yes'}" /> --> 
                        <apex:inputField id="LOB_WC1bb" value="{!Account_Summary__c.WC2_Comment__c}" Style="width:100%;height: auto;float: left;text-align: left;color:purple" rendered="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c='Yes'}" /> 
                    </apex:pageBlockSectionItem>  
    </apex:pageBlockSection>            
</apex:outputPanel>
</apex:tab>  

1 Answer 1

1

You should rerender <apex:pageBlockSection id="LOB_WC1"/> or individual <apex:pageBlockSectionItem dataStyleClass="test1" > items

<apex:actionRegion >                    
            <apex:inputField value="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c}" id="account__name" StyleClass="col2" >
                <apex:actionSupport event="onchange" reRender="LOB_WC1" / > 
                </apex:inputField>
</apex:actionRegion>

Reason behind this, unless below outputlabel is available on the screen, the following element could not be found. That's why your rendering is not working.

For example when Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c='No' then that outputPanel is not displayed on the screen and hence, actionSupport is unable to find that outputPanel.

<apex:outputLabel id="LOB_WC1a" value="Comment on analysis of Exposure" for="account__name" StyleClass="col1" rendered="{!Account_Summary__c.WC_portfolio_Hazard_Group_F_G_exposure__c='Yes'}" />

3
  • I was only able to rerender the <apex:pageBlockSection id="LOB_WC1"/> but not the <apex:pageBlockSectionItem dataStyleClass="test1" > As I load up several more pageBlockSectionItem's I'd like to rerender only those fields affected rather than rerender the entire Pageblock. Updated the source with the issue on pageblockSectionItem .
    – rickmac
    Commented Apr 20, 2017 at 13:16
  • if you understand the answer you could able to solve the issue Commented Apr 20, 2017 at 15:01
  • I revised the code to reflect recommendations but still not getting fields to render. I can't rerender the entire pageBlockSection 'LOB_WC1' as this will clear out fields set by the user. Any ideas ?
    – rickmac
    Commented May 2, 2017 at 16:03

You must log in to answer this question.

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