I have a custom controller that returns a map like this:
Map<String, String>
In my visualforce page, how do I access this map? Before the Winter '13 release, I could do this:
<apex:variable value="{!results[key]}" var="result"/>
However, this no longer works with the Winter '13 release. How do I do this in the latest release?
Edit: The VF page is at API version 24.0. The Controller is at 25.0.
This is in my Visualforce Page:
<c:Query_article_view>
<apex:variable value="{!results[articleid]}" var="result"/>
{!result}
</c:Query_article_view>
This is my component:
<apex:component controller="Article_View" access="global">
<apex:variable value="{!results}" var="results"/>
<apex:componentBody />
</apex:component>
This is my Apex Class:
global with sharing class Article_View {
global Map<String, String> results {
get {
KnowledgeArticleViewStat result;
List<KnowledgeArticleViewStat> results = [SELECT NormalizedScore, Id, ParentId FROM KnowledgeArticleViewStat WHERE Channel='Csp'];
Map<String, String> article_views = new Map<String, String>();
for (Integer i = 0; i < results.size(); i++) {
article_views.put(((String)results[i].get('ParentId')).substring(0,15) , String.valueOf(((Decimal)results[i].get('NormalizedScore')).round()));
}
return article_views;
}
set;
}
}
When I try and save my Visualforce Page, I get this error: Error: Expression of type Text cannot be subscripted