0

Persistant buttons

I may be dense on this one, but it seems like objects stay persistent on the sidebar. When I display a specific sidebar, I create mulitple buttons, say 10. Then if I go back to the previous sidebar, make some selection and return to the specified sidebar, the previous buttons still exist. I would suspect there is some way to delete these buttons when I move to another sidebar, but I have not been able to discern how to do this operation.
Any help would be appreciated.
Currently I hide buttons I don't need on subsequent displays of the sidebar, but this seems like the hard way to do this.

by
6 Replies
  • That "persistence" is for performance purposes. While in general we try to advise people to break outside the "web page" mentality, that actually does apply here a bit. When you hit back in your browser, you intend to go back to where you were and it to have the same general look and feel as it did when you left. Same applies here.

    If your view dramatically changes it's structure based on some parameters outside the view, we highly recommend splitting those into separate views, potentially all inheriting from a common base view which you create to minimize code reuse.

    -Jeremy
    0
  • That's a shame. It makes my life a little more difficult.
    Is there a way to overwrite buttons. I could add a next button. if selected I could overwrite the button image?
    0
  • 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!
    0
  • QUOTE (jsl4tv @ Aug 30 2010, 09:56 AM) <{POST_SNAPBACK}>
    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?
    0
  • CODE
    this.mybutton.suicide();
    0
  • QUOTE (WidgetRealm @ Mar 16 2011, 06:18 AM) <{POST_SNAPBACK}>
    CODE
    this.mybutton.suicide();



    Thank you very much.. I got my solution.
    0

Recent Posts

in Design / Interaction - Yahoo! TV Widgets