Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
So Salesforce is trying to access the Map now. However, I am getting a Map key not found in map error. I printed out the key and the values in the Map, and the KnowledgeArticleViewStat.ParentId does not match up with the KnowledgeArticle.Id. For example, I will have a KnowledgeArticleViewStat.ParentId that is a key in the Map that is kA1W00000004CMJKA2. Then my KnowledgeArticle.Id that I am trying to use as a key to access the Map is kA1W00000004CMJ. The last 3 letters are cut off for all the KnowledgeArticle.Id. Any ideas about this?
So I changed my Apex Class to return map <Integer,String> and I changed the component and Visualforce page like you wrote. "{!results}[key]" just displays the dictionary and then literally [key]. It doesn't actually try find the value of that key. So when I load my VF page, I get this: {...}[key]