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
sdharsdhar 

Calendar not visible for an inputfield in visualforce

I'm having issue displaying calendar popup for a date field in Visualforce. If I display the field on initial page it works correctly. But if I rerender it based on certain criteria, it doesn't show the pop up. 

 

Similar issue is listed in the below post
But using the outputpanel or the div as suggested did not work.
<apex:pageBlockSection>
 <apex:panelGrid columns="6" width="50%">
<div style="display:none">
<apex:InputField value="{<DATE FIELD>}" rendered="{!flag}"/>
</div>
</apex:panelGrid>
</apex:pageBlockSection>

 Added the div tag based on suggestio in above post.

Can someone help me?

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You are attempting to rerender a field that doesn't exist when the page is initially rendered.  You'll need to wrap it in an outputpanel that is always rendered.  I'd avoid going the hidden div route, as that will still result in an inputfield on the page which may overwrite information unexpectedly in the controller.

 

I wrote a blog post describing this behaviour at:

 

http://bobbuzzard.blogspot.com/2011/02/visualforce-re-rendering-woes.html