I have a cell table with an async data provider. If I update the data via the data provider the table renders the new data correctly but the selection model still holds onto and returns old objects.
Any ideas how to refresh the selection model?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you should make your
SelectionModelwork with different instance of the same “logical” object using the appropriateProvidesKey. For instance, you could useProvidesKeythat callsgetIdon the object, so that two objects with the same such ID would be considered equal; so even if theSelectionModelholds onto the old object, it can still answer “yes, it’s selected” when you give it the new object.FYI, this is exactly what the
EntityProxyKeyProviderdoes (using thestableIdof the proxy). And theSimpleKeyProvider, used by default when you don’t specify one, uses the object itself as its key.