Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Vaadin selectedTabChangeListener - need to capture originating tab

 
Greenhorn
Posts: 3
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I'm not sure if this is best for Beginning Java or the next level, but I'm afraid that the issue is something simple I'm missing because I'm so new so I am starting here.

I have an application that I am developing using the Vaadin framework. I have a stack of tabs that is added to each time you click a button representing different entities. The default close handler for a tab in Vaadin if you are closing the same tab that is currently selected is to make the first/bottom tab in the list the active tab. What I want to do is make the tab that was most recently selected, before the closed tab was selected, the active tab. I believe I can do this if I can capture the originating tab before a tab change event. Unfortunately, I can only find a way to capture the newly selected tab, not the one that was selected initially. I found a couple of code examples out there that have me do something similar to this:



stack is my TabSheet that I am working with. In debug, I see that the "selected" variable that I have before the event is processed is always null. It doesn't seem to get assigned the value as it apparently does in the examples I've found online.

Any ideas on how I can get this selected? I've been stuck on this for two days and I'm just sure it's something simple that I'm missing because I'm new and not thinking about things correctly.

Thank you!
reply
    Bookmark Topic Watch Topic
  • New Topic