function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrei KuznetsovAndrei Kuznetsov 

Problem with sorting by <apex:vote> component.

Hi,
We implemented custom Ideas using Idea Themes. The code works fine, but there is one problem. When ideas are resorted by Top Points and user goes to the next page of ideas, <apex:vote> components is displayed beside wrong records. For example, if my top idea has 200 points, and idea on the second page on the top only has 50 points, the 200 points will be displayed. I saw other people have the same problem, haven't seen any solution for it. Here is my code:
=========================================================================================================
<apex:pageBlock title="{!$ObjectType.Idea.LabelPlural} | {!$Label.Contributions}">
<apex:dataList style="list-style-type:none;" value="{!modifiedIdeas}" var="ideadata" id="apples">
<apex:outputPanel rendered="{!($CurrentPage.parameters.sort != 'comments')}" id="ideaOutput">
<apex:panelGrid columns="3" cellspacing="10" columnClasses="columnTop">
<apex:vote objectId="{!ideadata.Id}" id="vte" />
<apex:image style="border:2px solid #335CAD;" url="{!ideadata.CreatorSmallPhotoUrl}" height="40px" width="40px"/>
<apex:panelGroup >
<ideas:detailoutputLink styleClass="ideaTitle" style="color:#335CAD;" ideaId="{!ideadata.Id}" page="ViewPage">{!ideadata.Title}</ideas:detailoutputLink>
&nbsp;
<apex:outputText style="background-color:#FFFF94;font-size:12px;font-weight:bold;" value=" {!ideadata.Status} " rendered="{!ideadata.Status != ''}"/>
<br />
<span style="color:#990000; font-weight:bold; font-size:10px;">
<apex:outputText value="{!$Label.Posted_by}: "/>
<apex:outputLink style="text-decoration:none;" value="/apex/IdeaProfilePage?c={!currentZone}&u={!ideadata.CreatedBy.Id}&sort=ideas">{!ideadata.CreatedBy.CommunityNickname}</apex:outputLink>
<apex:outputText value="{!IF(ideadata.Categories != '',' -- ','')}" />
<apex:outputText value="{!SUBSTITUTE(ideadata.Categories,';',' | ')}"/>
<apex:outputText value=" -- {!ideadata.CreatedDate}"/>
<br /><br />
</span>
<apex:outputText escape="false" value="{!ideadata.Body}"/><br /><br />
<apex:outputLink styleClass="commentLink" style="color:#335CAD;" value="/apex/ViewPage?id={!ideadata.Id}">[{!ideadata.NumComments} {!$Label.Comments}]</apex:outputLink>
</apex:panelGroup>
<br />
</apex:panelGrid>
</apex:outputPanel>
</apex:dataList>
<apex:pageBlockButtons location="top">
<apex:commandButton value="{!$Label.Post_Your_Idea}" action="{!getPostPage}"/>
</apex:pageBlockButtons>
<apex:commandLink action="{!previous}" rendered="{!hasPrevious}" >{!$Label.Prev}</apex:commandLink>&nbsp;&nbsp;
<apex:commandLink action="{!next}" rendered="{!hasNext}" >{!$Label.Next}</apex:commandLink>
</apex:pageBlock>
==============================================================================================================
 
Best Answer chosen by Andrei Kuznetsov
Andrei KuznetsovAndrei Kuznetsov
For people who have similar problem. Don't waste your time on trying to fix your code. This is bug in SFDC, which was promised to be fixed at some time in the future.