You need to sign in to do that
Don't have an account?
Sarfaraj
Issue with date picker. I am unable to select the year/month from the standard datepicker.
Hi
I have created a custom VF page which opens a modal window with some date field in it. In the modal window I am unable to change the year/month from the dropdown. It is getting reset to the old value immediately. Below is my code,
--Akram
I have created a custom VF page which opens a modal window with some date field in it. In the modal window I am unable to change the year/month from the dropdown. It is getting reset to the old value immediately. Below is my code,
<apex:page standardController="Account"> <apex:includeScript value="https://code.jquery.com/jquery-2.1.1.min.js"/> <apex:includeScript value="https://code.jquery.com/ui/1.11.2/jquery-ui.min.js"/> <apex:stylesheet value="https://code.jquery.com/ui/1.11.2/themes/black-tie/jquery-ui.css"/> <script> $(function() { $( "#modalWindow" ).dialog({ autoOpen: false, height: 'auto', width: 600, modal: true, resizable: false }); }); DatePicker.prototype.position = function (){ for(var a=0,b=0,c=this.myElement;null!=c&&c!=this.calendarDiv.offsetParent;) a+=c.offsetLeft-c.scrollLeft,b+=c.offsetTop-c.scrollTop,c=c.offsetParent; b=getObjY(this.myElement)+this.calendarDiv.offsetHeight>Sfdc.Window.getScrollY()+Sfdc.Window.getWindowHeight()?getObjY(this.myElement)-(this.calendarDiv.offsetHeight+120):getObjY(this.myElement)-90; c="left"; LC.isRtlPage()&&(c="right",a=this.calendarDiv.offsetParent.offsetWidth-a-this.myElement.offsetWidth); this.shim.setStyle(c,a+"px"); this.shim.setStyle("top",b+"px"); } </script> <style> .datePicker { z-index: 2000; } </style> <apex:pageBlock > <apex:pageBlockSection > <apex:outputField value="{!Account.Name}"/> </apex:pageBlockSection> <a href="#" onclick="$('#modalWindow' ).dialog('open');">open</a> </apex:pageBlock> <div id="modalWindow"> <apex:form > <apex:pageBlock > <apex:pageBlockSection > <apex:inputField value="{!Account.SLAExpirationDate__c}"/> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}" oncomplete="$('#modalWindow' ).dialog('close');" reRender="none"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </div> </apex:page>
--Akram
May these contributions will help to achieve your requirement
http://improveit360.blogspot.in/2010/09/gotchas-using-jqueryui-to-make-popups.html
http://cloudforcedev.blogspot.in/2012/04/issue-with-salesforce-datepicker-when.html
Actual issue is with the z-index, seems you need to play arround modifying this value
All Answers
Hi Akram,
I have copied the same code and ran it.(i ran this on Chrome browser) it hold the last selected date from date picker.
The issue might be with the browser. please verify.
If you could explain more what you trying to achieve !! i may help you.
Thanks a lot for your effort. I know how to bind and use custom datepicker. I am not looking for this kind of solution. I want to use the standard datepicker provided by salesforce. Only issue I am facing is that it is getting reset after selecting any value from the select list.
--Akram
Yes there are some issues with the date-picker on the pop-up dialog. You can customize jquery datepicker which will have same feature like SF standard on modify my above code with
Hope this will work for you.
May these contributions will help to achieve your requirement
http://improveit360.blogspot.in/2010/09/gotchas-using-jqueryui-to-make-popups.html
http://cloudforcedev.blogspot.in/2012/04/issue-with-salesforce-datepicker-when.html
Actual issue is with the z-index, seems you need to play arround modifying this value