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
Venkatramanan LakshmananVenkatramanan Lakshmanan 

<apex:vote> component behaviour in pagination

Hi all

I have a custom VF page to list the Ideas. I have included pagination to display 5 ideas per page. I have used <apex:vote> component to display the promote/demote details.

The issue is, the first time the page is displayed, the vote component is bindied properly. Once we hit the 'Next Page' link, the vote component remains the same as the first page irrespective of the current idea status. I have displayed the associated Idea id to make sure that new ids are bindied and it is.

Is this a Salesforce VF issue or Is there any set up that needs to be done to refresh the VF vote correctly? Can somebody point us in the right direction to resolve this issue?

Thanks
Gaurav NirwalGaurav Nirwal
if (!empty($this->data['users']['gender'])) {
        $conditions['gender'] = $this->data['users']['gender'];
    }
    if (!empty($this->data['users']['country_id'])) {
        $conditions['city_id'] = 
            $this->User->City->find(
                'list', 
                array(
                    'conditions' => array(
                        'country_id' => $this->data['users']['country_id']), 
                    'fields' => 'City.id'));
    }
    if (!empty($this->data['users']['city_id'])) {
        if($this->data['users']['city_id'] == 'NULL') {
            $conditions['city_id IS ?'] = NULL;
        } else {
            $conditions['city_id'] = $this->data['users']['city_id'];
        }
    }
    //debug($this->data);

    $options = array(
        'limit' => 20,
        'order' => 'User.lastname ASC',
        'conditions' => $conditions);
    $this->paginate = $options;
    $users = $this->paginate('User');

As you can see, I use the paginate() function within the controller. I still don't understand why it's working for the gender filter and not the rest
Andrei KuznetsovAndrei Kuznetsov
Hi,
I'm having exactly the same problem. Have you solved it? If not, myself I'm going to contact SF, since the problem is apex:vote component.
Thanks,