I found two different strategies to deal with a similar problem in various versions of our widget. You can call .show() and .hide() in the updateView() to make buttons only show up when the context is appropriate. We often need to display a list of things on our pages. The lists are of varying lengths, and back, select a different item, forward will almost always result in a different list of items. Although the .show() .hide() strategy would work, an alternate strategy that requires less custom code is to use the grid UI elements, and add buttons (unlabeled and do-nothing) as contents of a grid cell.
Hope that helps!
I am also having with the same problem. when first time the button is created, the button gets focused. then when going the the same sidebar again, the previous controls remain exists but does not get focused if new controls is created. And if no control is created the previous buttons remains active.
I need to delete the previous buttons and show only the new buttons and make it clickable.
Will someone please give me code snippet so that I can relief from this curse?