function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Calendar popup not showing for inputfield

Hi there.

I have an inputField (of type date) on my visualforce page.

It is placed in a pageBlockSection which resides in a pageBlock.


Initially the pageBlock is not rendered.

When it is finally rendered (after another visualforce component calling a rerender on this pageBlock) the calendar popup will not show. If I move the offending inputField to another pageBlock which is always rendered, the popup calendar for the field will show up as normal.


Any suggested work arounds?



Richie DRichie D

When a date field is on the page and not rendered SF doesn't bother to run the correct Javascript when the page loads(or doesn't include it in the page at all). What you can do is put the inputfield in an outputPanel (or html div) and set the style for the panel to be display:none.


Should work... 


Hi Richie,

That's what I was thinking alright.

I tried putting an outputPanel around the inputField and setting the style display to visible and none

and neither works unfortunately...

Also tried a rerender on the outputPanel around the inputField after it should be shown and that didn't

work either.

The inputField is in a pageBlockSection which is in a pageBlock.



Richie DRichie D

<apex:page standardController="Assessment__c" extensions="AssessmentAdmin">

<apex:form >

<apex:pageblock >

<apex:commandButton action="{!setDateTo2010}" value="clickme" rerender="pbs"/>

<apex:pageblocksection id="pbs">

<apex:inputField value="{!Assessment__c.Assessment_Date__c}" rendered="{!Assessment__c.Year__c == '2010'}"/> </apex:pageblocksection>


<div style="display:none;">

<apex:inputField value="{!Assessment__c.Assessment_Date__c}"/>




 This works ok for me. method setDateto2010 means the inputfield is switched on or off. Initially it is not rendered.

Without the 2nd input field staement the popup doesn't 'popup'.


This help? 

Message Edited by Richie D on 05-28-2009 11:00 AM

Unfortunately it didn't work for me,

here's a breakdown of what I have.



<apex:outputPanel id="optionsPanel"> <apex:form > <apex:pageBlock title="Availability Options For {!contextAgentTableRecord.agent.Name}" rendered="{!showAvailabilityBlock}"> <apex:pageBlockSection columns="1"> <div style="display:none;"> <apex:inputField value="{!proxyObj.Requested_Schedule_Date__c}" style="width:90px;" /> </div> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:outputPanel>




Richie DRichie D

<apex:outputPanel id="optionsPanel"> <apex:form > <apex:pageBlock title="Availability Options For {!contextAgentTableRecord.agent.Name}" rendered="{!showAvailabilityBlock}"> <apex:pageBlockSection columns="1"> <apex:inputField value="{!proxyObj.Requested_Schedule_Date__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form><div style="display:none;"> <apex:inputField value="{!proxyObj.Requested_Schedule_Date__c}"/> </div></apex:outputPanel>

 Perhaps something like this?