Multiple Tables on top of each other, Data Querying slowing things down

I have a page with 4 tables on top of each other and a nav bar at the top to switch between them. When the page first opens it is very slow, presumably because all these tables are now querying for their data.

How can I make it so that the three hidden tables are querying in the background for information instead of holding up the program? Is this an instance for system.util.invokeLater()?

What component are you using for your ‘Nav bar’?

Typically I use either radio buttons or a drop down to assign what query to put into a power table. Instead of having multiple power tables to choose from. you might be able to do something similar depending on the component used.

2 Likes

It’s done with tabs. But that’s a good idea, instead of having 4 tables that turn on and off visibilty with the tab strip, maybe just use it to switch what data the single table is viewing is what you are saying?

Yeah you might be able to do something similar with tabs.

For radio buttons, I just use the following two lines:

data = system.db.runNamedQuery(“ValveCover”, {})
event.source.parent.getComponent(‘Power Table’).data = data

And that will take the results and set it in the table. Unfortunately, it looks like there isn’t an ‘actionperformed’ for tab strip, so you might need to get creative, or maybe try propertyChanged.

1 Like

I’m giving you the solution because I realize this is the most sensible route to go. I also noticed on this page, each table had a different set of side buttons associated with it, and they’re made to be invisible on top of each other when not selected and what not - are all these invisible GUI components slowing my project down? I figure when I switch to one table I am only going to have ONE set of buttons whos action will just be condition on what tab/radio button is selected.

Buttons shouldn’t be doing much on their own. So I would guess that the tables and the queries are what are slowing you down the most, unless there are other transactions or queries running along side of this screen.