1 Reply Latest reply on May 17, 2010 7:27 AM by andrewthorp

    Custom equality?

    andrewthorp Level 1

      I am using Flex with will paginate in ruby. The user sees two columns, the column on the left is the current 'page' of contacts that they pulled from the database. The column on the right is the selected contacts that the user has added as a recipient.

       

      When the user clicks the 'ADD' button on the left side, I add the dataProvider (ContactVO) to the selectedRecipients array collection. The left sides 'ADD' button then says 'ADDED' and is disabled. When the user pages away and comes back to this page, the 'ADD' button is clickable again, because while the ContactVO is almost identical, it is not the same - even though the data is.

       

      So basically, I was wondering how I can get currentPage.lastIndexOf(dataProvider) to not be '-1' when the VO's are updated. I would imagine if I could adjust a method that decides if they are equal based on the property id:int in the VO, that would work...

       

      Any ideas?