• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Vaadin selectedTabChangeListener - need to capture originating tab

 
Greenhorn
Posts: 3
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!