Previous Tab in TabFolder and SelectionEvent [message #21310] |
Wed, 02 May 2007 16:49 |
Eclipse User |
|
|
|
Originally posted by: roberto.sanchez.autonomind.com
Hi all, I'm using a TabFolder with multiple tabs to input data from
user, I store all data in an object and when user clicks on "Save" this
object save all data in MySQL, Well, my problem is:
I would like (for several reasons) to send current tab data to my object
every time user change the selected tab, Is there any automatic way to
get the previous tab selected ? I can do it manually saving the current
tab and so on, but if there is a better way...
On the other hand, I change the selected tab from code in several
situations, using:
tabfolder.setSelection(newTab);
But, in this case a Selection Event is never fired, Is this the correct
behaviour ?
Regards.
Roberto.
|
|
|
Re: Previous Tab in TabFolder and SelectionEvent [message #21559 is a reply to message #21310] |
Wed, 02 May 2007 18:55 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Hi Roberto,
there is no way to obtain the previously selected tab, except for
keeping track of the selection yourself as you already mentioned.
Regarding the SelectionEvent, it is correct behaviour. SWT fires it when
the first TabItem is added (and automatically selected), but changing
the selection programmatically does not cause a SelectionEvent.
Cheers
Rüdiger
Roberto Sánchez wrote:
> Hi all, I'm using a TabFolder with multiple tabs to input data from
> user, I store all data in an object and when user clicks on "Save" this
> object save all data in MySQL, Well, my problem is:
> I would like (for several reasons) to send current tab data to my object
> every time user change the selected tab, Is there any automatic way to
> get the previous tab selected ? I can do it manually saving the current
> tab and so on, but if there is a better way...
>
> On the other hand, I change the selected tab from code in several
> situations, using:
>
> tabfolder.setSelection(newTab);
>
> But, in this case a Selection Event is never fired, Is this the correct
> behaviour ?
>
> Regards.
> Roberto.
|
|
|
Powered by
FUDForum. Page generated in 0.03070 seconds