Is there a way to refresh the power table for the client once a query has run? As of right now, the client has to navigate to another window then go back for the power table to refresh with the new data even though the dataset has already been updated. I have tried the db.refresh script below and well did not work as expected. Any way to get around this?
Now I see the script but it wasn’t there when I looked the first time. Is there a reason your doing the biding on a custom property and not just on the data section of the power table?
With passing it through an expression, the refresh on data for the power table won’t work. It would trigger the expression to run again which I don’t believe would cause the custom property to refresh. Is there a reason it has to be done that way?
Just went back and read that and realized how vague it was. We have 4 custom properties, each are binded to a different query. Then we have a expression that chooses which one by a checkboxes from the screen.
At the same time though, if you are running 4 different queries that return similar data like you mentioned, I’d have to wonder could you pass in a parameter to bring it down to one query. If all the queries are similar enough it would be easy to do and cut back the calls to your database when the page loads.
If you can I personally would. You could use your expression to determine the variable that is passed in based on your check boxes. Or a series of expression bindings linked to each check box if needed.
If more than one could be checked at one time then it would probably need to be a series of them doing an OR in your query to look for the data that is selected. If its the full value in a field that your filtering by you can have the expression make it that when the box is checked and as long as you have no blanks in the column you can make it filter for null to ignore that filter.
Then your query could be run from the table itself or if you want it in a custom property it can be directly linked to the table.
It also has the added benefit of you only have one query to maintain instead of 4 if a change is needed later.
Maybe I was doing something wrong, but I could not get system.db.refresh() to work no matter where I put it.
I did find a solution, not sure if it is the best way to do it, but does get the job done. Basically the the primary use is I have a full list of sites on the left power table and just specified sites on the right power table. I have a add button and remove button. I added the below to the mouse released function to both and seems to work exactly how I need it to.
I write a little piece of code to make easier refreshing multiple tables, but still do not get it work,
is there a way to refresh multiple components?
this is the code i write but i get the error :
TypeError: refresh(): 1st arg can’t be coerced to javax.swing.JComponent
List = [ “Power Table”,“Power Table 1”]
ListName = [“Component”]*len(List)
for i in range(len(List)):
ListName[i] = “event.source.parent.getComponent(’”+str(List[i])+"’)"