You need to sign in to do that
Don't have an account?
Felix van Hove 9
apex:inputField showDatepicker does not work without use of the standardStylesheet
apex:inputField does not seem to work with datePicker and dateTimePicker, if the SF standardStylesheet is not used. A page with the simple code
<apex:page sidebar="false" showHeader="false" standardStylesheets="false" standardController="Contact">
<apex:form><apex:inputField showDatepicker="true" value="{!contact.birthdate}"/></apex:form>
</apex:page>
produces Javascript error messages as soon as the input field gets the focus in the rendered page:
Uncaught TypeError: Cannot read property 'currentStyle' of null
at Object.getStyle (main.js:407)
at Object.setStyle (main.js:406)
at iframeShim.setStyle (main.js:1350)
at DatePicker.hide (main.js:658)
at HTMLDocument.DatePicker.closeHandler (main.js:646)
getStyle @ main.js:407
setStyle @ main.js:406
setStyle @ main.js:1350
DatePicker.hide @ main.js:658
DatePicker.closeHandler @ main.js:646
Navigated to [...]
main.js:18 Uncaught TypeError: Cannot read property 'addEventListener' of null
at main.js:18
at new DatePicker (main.js:646)
at Function.DatePicker.getDatePicker (main.js:659)
at Function.DatePicker.pickDate (main.js:660)
at HTMLInputElement.onfocus (Test:7)
[...]
Is this a bug in Salesforce's Javascript? Or what limitations exist in the use of date and date-time pickers? Or have I missed anything?
<apex:page sidebar="false" showHeader="false" standardStylesheets="false" standardController="Contact">
<apex:form><apex:inputField showDatepicker="true" value="{!contact.birthdate}"/></apex:form>
</apex:page>
produces Javascript error messages as soon as the input field gets the focus in the rendered page:
Uncaught TypeError: Cannot read property 'currentStyle' of null
at Object.getStyle (main.js:407)
at Object.setStyle (main.js:406)
at iframeShim.setStyle (main.js:1350)
at DatePicker.hide (main.js:658)
at HTMLDocument.DatePicker.closeHandler (main.js:646)
getStyle @ main.js:407
setStyle @ main.js:406
setStyle @ main.js:1350
DatePicker.hide @ main.js:658
DatePicker.closeHandler @ main.js:646
Navigated to [...]
main.js:18 Uncaught TypeError: Cannot read property 'addEventListener' of null
at main.js:18
at new DatePicker (main.js:646)
at Function.DatePicker.getDatePicker (main.js:659)
at Function.DatePicker.pickDate (main.js:660)
at HTMLInputElement.onfocus (Test:7)
[...]
Is this a bug in Salesforce's Javascript? Or what limitations exist in the use of date and date-time pickers? Or have I missed anything?
Let me know if this helps.