Encode and serialize PK to allow composite keys in widget