Hi All
I would like to have 3 dependent dropdowns ie. first dropdown allows selection from the dataset from the db, then second dropdown filters further based on selection from the first dropdown - same applies to dropdown 3 which filters based on the selection of 2 previous dropdowns.
The code works rather slowly only when cyclic refresh to the custom property pulling data from the db is enabled. This custom property with the dataset is on the root level.
How can i make my code event based without cyclic polling?
Dataset is pulled from the named query without any parameters needed and is further processed using transform script.
I am using options property binding from the dropdowns to the dataset.
Regards
Turn polling off, then whatever you want to trigger a binding refresh, use refreshBinding
self.getSibling("dropdown").refreshBinding("props.options")
1 Like
If I understood correctly, you want your dataset to be collected and then you don't want it to keep refreshing itself?
I would setup a message handler using system.perspective.sendMessage() on your view that you send when the view is opened, or any other time you find it necessary.
Then in your message handler you can use the system.db.runNamedQuery() function in the script and assign the result to your custom property.
This way lets you refresh the information exactly when you want.
1 Like
Instead of running the query in the message handler, I think it would be cleaner to set up a query binding and call refreshBinding
from the handler.
1 Like
thanks for reply.
So in my example of 3 dropdowns where to i need to put the refresh call ? My understanding is that when the selection on 1st dropdown is made it should refresh the options property on the 2nd dropdown. So do i put the refreshBinding("2ndDropdown.prop.options") call in the "value" property of the first Dropdown? Should it be expression type binding?
Regards
On first dropdown i created event onActionsPerformed and from there i used the code self.getSibling("2ndDropdown").refreshBinding("props.options").
I hope that is what you meant ? @dkhayes117
It works a lot faster as its event based
1 Like
You don't need to refresh the dropdowns' bindings.
Simple bindings don't usually need to be refreshed.
What might need to be refreshed, is a table displaying the data, if your dropdowns are acting as filters.
And even that might not need to be manually refreshed.
Tell us more about what you're trying to do, so we can properly help you find a proper solution.
2 Likes