5

I have an input like this

<apex:input type="date" value="{!myMap[myKey].DateValue}" />

In my apex:page i have put the docType="html-5.0" attribute but i can't save the file with this compilation error:

Compilation Error: "Expected input type 'text'", got 'date' for Id data type

Any idea?

  • 1
    post your apex code, looking for map definition ( ie) map<x,y> something = new map <x,y>(); and the place where you populate the map (ie) map. put( '',''); – Rao Oct 1 '14 at 17:45
  • Worth checking is whether your browser is supporting html5 or not.... Even though if you are rendering the vf page with doctype. You can check browser compatibility in html5test.com – Kiran Mutturu Oct 1 '14 at 17:49
  • There is a similar posting on the Discussion Forums. The suggestion there is that the datatype for binding is coming from the Maps key rather than the resulting value. – Daniel Ballinger Oct 1 '14 at 18:31
  • Also, what API version are you using for the Visualforce page? – Daniel Ballinger Oct 1 '14 at 18:36
  • I'am using API version 31, when i bind it to a Date field type -> It works But when i use Map<String,CustomObject__c> and (in a repeat context) and Bind that input to a <apex:input type="date" value="{!myMap[myKey].myCustomDateField__c}" /> it does not let me save the file (compilaiton problem) – Akram G Oct 2 '14 at 8:30
0

I can confirm this is happening to me too, I am using a wrapper around my object, it happens sporadically, in some VF pages, in others it doesn't

VF Page:

<apex:page showHeader="false" sidebar="false" controller="ApplicationController" docType="html-5.0">
...
   <apex:pageBlockSectionItem >
      <apex:outputlabel value="{!$Label.MyCustomLabel}" />
      <apex:input type="date" value="{!universities[0].StartDate}" />
   </apex:pageBlockSectionItem>

Controller:

public List<UniversityWrapper> universities;

public class UniversityWrapper {
...

        public Date StartDate {
            get { return this.university.Start_Date__c; }
            set { this.university.Start_Date__c =value; }
        }
}
  • Jordan -- useful - but not an answer unless you have a workaround; – cropredy Apr 16 '16 at 1:37
  • 1
    Well a comment doesn't really encapsulate and starting another question is just duplicative – jordan.baucke Apr 16 '16 at 2:27
  • 1
    yeah, I get it -- but forum moderators can be kind of strict here and was trying to give you a chance to 'enhance' – cropredy Apr 16 '16 at 2:50
  • 1
    Does the above code reproduce the issue? If not then the code does not seem to add much value and the rest can just be a comment – Eric May 3 '17 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.