I am attempting to save and restore a view hierarchy consisting of a table of buttons. The number of table rows and buttons required in the table is not known until runtime
If it works with Views with an ID, why not give each button an ID in the table when you are creating them? See if that works.
How can I assign an ID to a view programmatically?