This was my first approach. However, the code looks like more complicated (at least in my first approach :S) because I had to persist the options object and add 'ID's' to the buttons in order to identify which target is tied to each method. That's why at the end I changed the code to this (in order to simplify it). Any proposal?