onAction for tabPanel tabs

It would be much better for me if there is an onAction event for tabs in tabPanel. The reason for the need is as follows:

Currently in many of my tabPanels I set the foundset of the form linked to each tab (tabForm) during the onShow event of the tabForm. The old foundset of the tabForm shows for a while before the new foundset is set through the onShow event of tabForm.

This is quite not neat. Even it can go worse if there is a network congestion and the network is a bit slow as it can confuse the users since they may be looking at an older foundset. So I want to set the foundset before the tabForm is even displayed.

Thanks a lot!!!

I am new to Servoy, but you can set the tab panel to "hide’ and then create your own tabs. You can then apply an on action method as well as other options, such as rollover images, to the tabs which you create.

Hope this is helpful.

Carmen Scoma

As far as I can see there is no way to add an action/event to a tabpanel (and with that I am not talking about Servoy but about Java).

Having that said you can add a method to the on show of your current form (the one that has the tabpanels on them) to add the correct founset, viewable elements and whatever it is you want to on the forms of the tabpanel. That way there is no delay when you show the forms in the tabpanel.

Hope this helps

Are you talking about the JTabbedPane of javax.swings ?

Is servoy’s tabPanel not different one to the JTabbedPane?

Also I can see in java 5.0 manual that for JTabbedPane we can add a listener to listen for a tab change event.

addChangeListener(ChangeListener l)

As for as setting up the foundset and viewable elements before hand, I can do that in onRecordSelection event. Actually I wanted to do the foundset when the user clicks the tab. I am running SQL and loadRecords to set the foundset of the form within the tab. So I do not want to set the foundsets of all the tabs in the onRecordSelection of parent form since it can costs a lot having to set the foundset of all the tabs at one time. So now I am setting the foundset of each tab during the onShow of the internal tabForm.

So if we have something like onTabSelectionChange for tabs I can call the method which sets the foundset in that event handler.

has been discussed at length in topic: onTabAction - Classic Servoy - Servoy Community

Would be added in 3.0 beta’s, but hasn’t happened as far as I know.

Paul

ok…

And it is possible to register a TabChange event:
http://javaalmanac.com/egs/javax.swing/tabbed_TpEvt.html

BTW: Another nice enhancement would be the following:
http://www.javaworld.com/javaworld/jw-09-2004/jw-0906-tabbedpane.html

It would allow you to create a tabbed interface, like FireFox uses. Especially great if we get the ability to clone forms and reuse them. In a CustoemrCare system, you could then offer the ability to users to open multiple customers at once, in separate tabs, with the ability to click the X on the tab to remove the tab. Wouldn’t that be neat? :D

Heared that Java 1.6 incorparates new JTabbedPane functionality to make the tabheader (the part you click on to switch tabs) more progamatically controllable, by allowing to make it any component…

Paul

pbakker:
And it is possible to register a TabChange event:
http://javaalmanac.com/egs/javax.swing/tabbed_TpEvt.html

Thanks for the pointer, the strange thing is that the tool(s) I use didn’t show it :(

You mean on the Java JTabbedPane, or on the Servoy TabPanel?

The Servoy TabPanel uses the JTabbedPane, as far as I can see, adding certain functionality, like the ability to hide the tabs, but also hides many other functions from view.

Paul

It is of no importance at all (anymore) but it is on JTabbePane. But again just disregard it was more to give a little info where my original posting comes from…