You need to sign in to do that
Don't have an account?
render pageblock section based on query result
I can't seem to control rendering a page block section . For result sets that are not empty the pageblock section remains unrendered.
<apex:actionRegion > <apex:selectList value="{!SelectedSubmissions}" multiselect="true"> <apex:selectOptions value="{!SubmissionOptions}"/> </apex:selectList><p/> <apex:commandButton value="Select Submissions" action="{!getSelectedSubmissions}" rerender="section2ba,out2a,out2b,out2ba,out2c,out2d,out3a,out3b,out8,out8h,globalMessages" status="status"/> </apex:actionRegion> <apex:actionRegion > <apex:pageBlockSection columns="1" id="section2ba" title="* Expiring Quota Share Contract Information" showHeader="true" rendered="{!NOT(!contractQSSectionList.empty)}" > <apex:outputPanel id="out2ba"> <apex:actionstatus startText="loading..."> <apex:facet name="stop" > <apex:outputPanel > <apex:dataTable style="text-align:right;" value="{!contractQSSectionList}" var="cqs" rules="all" cellpadding="5" > <apex:column value="{!cqs.MR_Contract__c}" headerValue="Contract"/> <apex:column value="{!cqs.Name}" headerValue="Section"/> <apex:column value="{!cqs.Brokerage__c}" headerValue="Brok%"/> </apex:dataTable> </apex:outputPanel> </apex:facet> </apex:actionstatus> </apex:outputPanel> </apex:pageBlockSection> </apex:actionRegion>
Go through the below code,I think it will heps for you,
Public void getselectedrecdtype(){
lstevnt1 = new List<Recordtype>([SELECT id,name FROM RecordType WHERE SobjectType='Event' AND id=:selectedevt]);
if(selectedevt == 'xyz') {
isAcceptedRC = true;
isAcceptedRC1 = false;
}
else{
isAcceptedRC = false;
isAcceptedRC1 = True;
}
}
<apex:selectList value="{!selectedevt}" size="1">
<apex:selectOptions value="{!evntdetails}"/>
<apex:actionSupport event="onchange" action="{!getselectedrecdtype}" reRender="ajaxrequest,ajaxrequest1" status="actStatusId" />
</apex:selectList>
<apex:outputpanel id="ajaxrequest" >
<apex:outputpanel rendered="{!isAcceptedRC==true}">
<apex:pageBlock title="Event 1 Details">
<apex:pageblockSection columns="2" >
<!-- This part will render once isAcceptedRC = true --->
</apex:pageblockSection>
</apex:pageBlock>
</apex:outputPanel>
</apex:outputpanel>
<apex:outputpanel id="ajaxrequest1" >
<apex:outputpanel rendered="{!isAcceptedRC1==true}">
<apex:pageBlock title="Event 2 Details">
<apex:pageblockSection columns="2" >
<!-- This part will render once isAcceptedRC1 = true --->
</apex:pageblockSection>
</apex:pageBlock>
</apex:outputPanel>
</apex:outputpanel>
Thanks,
Raghavendra Reddy.D