+ Start a Discussion
rohitmaratherohitmarathe 

Possible VisualForce Bug for apex:pageBlockSection Tag

Hi,

This is a small VF bug I found when I was adding pageBlock section inside repeater control. I found that when I do so the maximize minimize functionality of page block section stops working.

 

Here is my code for the VF page

 

<apex:page standardController="ToDos__c" extensions="ToDosController">
	
	<apex:sectionHeader title="Weekly View" subtitle="{!ToDos__c.Name}"/>
	
	<apex:form > 
		<apex:pageBlock >
		


			<apex:repeat value="{!lstInner}" var="ToDoItem">
				<apex:pageBlockSection title="Week {!ToDoItem.weekNumber}" columns="1">
					<apex:pageBlockTable value="{!ToDoItem.lstDailyItems}" var="dailyItem">
						Some <apex:column> tags here
					</apex:pageBlockTable>
				</apex:pageBlockSection> 
			</apex:repeat>
		</apex:pageBlock> 
	</apex:form>
	
</apex:page>

When  this page gets rendered minimize maximize functionality for all pageBlockSection tags was not working but was going js error.

 

I just added one more hidden page block section before my repeater and all pageBlockSections started working properly.

 

<apex:page standardController="ToDos__c" extensions="ToDosController">

<apex:sectionHeader title="Weekly View" subtitle="{!ToDos__c.Name}"/>

<apex:form >
<apex:pageBlock >

<apex:pageBlockSection title="Week" columns="1" collapsible="true" rendered="false"/>

<apex:repeat value="{!lstInner}" var="ToDoItem">
<apex:pageBlockSection title="Week {!ToDoItem.weekNumber}" columns="1">
<apex:pageBlockTable value="{!ToDoItem.lstDailyItems}" var="dailyItem">
Some <apex:column> tags here
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:repeat>
</apex:pageBlock>
</apex:form>

</apex:page>

 This might not be a right way to overcome the bug, but it works.:manhappy:


Similar is applicable in many other cases.

 

For example if default calendar (datepicker) is not working for the Date type inputField inside pageblock table.(I have observed this for Task as a standardController). You add one Date type inputField as hide it. All datepickers on the page will start working properly.

 

Experts on VisualForce can give better solution than this.

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
stephanstephan

Thanks for the post and the workaround. This is a known VF bug that we're working on fixing for the next release this fall.

 

...stephan

All Answers

stephanstephan

Thanks for the post and the workaround. This is a known VF bug that we're working on fixing for the next release this fall.

 

...stephan

This was selected as the best answer
rohitmaratherohitmarathe

Thanks for the update Stephan.