• Vijay Kashyap
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I'm having trouble using the new html5 compliant apex:input field.  I'm working with maps and trying to set a number in the value part of the map, related to a corresponding Id key.  The map is called "prodQty" and an entry in the map might look like {XXXXXXXXXXXXXXXXXX,10} so the Key is an Id and the value is a number.

 

Here is a sample of what works using a normal input:text field:

 

<apex:inputText value="{!prodQty[p.Id]}" />

 All this does on the VF page is simply create an inputText field and display the corresponding number from the map.  I can change that number and it updates the map no problem.

 

I wanted to use the HTML5 number type and so set it up with this code:

 

<apex:input type="number" value="{!prodQty[p.Id]}" />

 Looks pretty standard to me, but I get this error:

 

Expected input type 'text', got 'number' for Id data type

 

It seems to be pulling through the key of the map rather than the value which is odd, because with a standard inputText component the value syntax works perfectly so why does the new component not recognise that I'm pulling through a number instead of an Id?  Is it impossible to use this new component with a map value?  It'll be an unfortunate limitation if that's the case!

 

Thanks for any advice.