You need to sign in to do that
Don't have an account?
Rendering PageBlocksectionItem Problem
I would like to render a PageBlockSectionItem based on the previous question. When I encapsulate the PageBlocksectionItem within outputpanel tags, it is not displayed in the way I would like it when I DONT have the PageBlockSectionItem encapsulated in the outputpanel tags.
The below code is displayed fine.
<apex:PageBlocksectionitem>
<apex:outputLabel value="Security Value"/>
<apex:panelgrid columns="1">
<apex:outputText value="{!v_opp.Security_value__c}" rendered="false"/>
<apex:inputField value="{!v_opp.Security_value__c}" id="Security_value__c" />
</apex:panelgrid>
</apex:PageBlocksectionitem>
The when i encapsulate the code within Outputpanel. the field is not displayed as it should.
<apex:outputPanelid="SecurityValue"rendered="{!AND(v_opp.Type_of_Security__c == 'Other')}">
<apex:PageBlocksectionitem>
<apex:outputLabel value="Security Value"/>
<apex:panelgrid columns="1">
<apex:outputText value="{!v_opp.Security_value__c}" rendered="false"/>
<apex:inputField value="{!v_opp.Security_value__c}" id="Security_value__c" />
</apex:panelgrid>
</apex:PageBlocksectionitem>
</apex:outputPanel>
what I am doing wrong?
Found the solution. You need to encapsulate the code in Page Section before encapusulating it in OutputPanel.
<apex:outputPanelid="SecurityValue"rendered="true">
<apex:PageBlockSection id="test" rendered="{!AND(v_opp.Type_of_Security__c == 'Other')}">
<apex:PageBlocksectionitem>
<apex:outputLabel value="Security Value"/>
<apex:panelgrid columns="1">
<apex:outputText value="{!v_opp.Security_value__c}" rendered="false"/>
<apex:inputField value="{!v_opp.Security_value__c}" id="Security_value__c" />
</apex:panelgrid>
</apex:PageBlocksectionitem>
</apex:PageBlockSection>
</apex:outputPanel>
All Answers
Found the solution. You need to encapsulate the code in Page Section before encapusulating it in OutputPanel.
<apex:outputPanelid="SecurityValue"rendered="true">
<apex:PageBlockSection id="test" rendered="{!AND(v_opp.Type_of_Security__c == 'Other')}">
<apex:PageBlocksectionitem>
<apex:outputLabel value="Security Value"/>
<apex:panelgrid columns="1">
<apex:outputText value="{!v_opp.Security_value__c}" rendered="false"/>
<apex:inputField value="{!v_opp.Security_value__c}" id="Security_value__c" />
</apex:panelgrid>
</apex:PageBlocksectionitem>
</apex:PageBlockSection>
</apex:outputPanel>
I am also familiar with this problem.
PageBlockSectionItem does not get rendered properly. So in order to refresh this section item we need to keep this in output panel or need to keep all components of page block setion item in a output pabel and make this output panel as a child of this page blocksection item.