How does ui.get-visual-state work?
During a map change event I'd like to run a workflow to check the state of a component - if component active, update chart, if not, exit.
I'm trying to use the ui.get-visual-state operation and can't seem to get it to work. Using the item:// id of the component causes the operation to fail with error. If I use the div id of the component I can get ui.get-visual-state to work but all it does is return undefined - even if the component is active.
From the docs I think I'm understanding ui.get-visual-state and how it works but can't seem to figure it out. Help would be appreciated.
-
Hi Andrew,
I'm afraid ui.get-visual-state operation might not be the right one serving what you're attempting to do. Only a few Web components currently use visual state, and ui.get-visual-state indicates their different states, not active or not (e.g. panel - "normal", "maximized", "minimized")
Web has a function for checking if a component is active, but it's not exposed as an operation. It would require custom code to use it.
We're considering, in near future, to add an operation to determine whether or not a component is active, and also improve the GXW API docs to provide more helpful information.
Kind Regards,
Pairin
1 -
+1 from me for adding a command/operation to do that. For testing purposes I wrote a custom workflow element to try and grab specific gxc-id's on the divs from the viewer. Does seem to work but have not put into production. It also adds complexity trying to talk between a workflow and a map view event.
The end goal is: if workflow A is open/running activate workflow B on map move events. When workflow A closes, kill B map move workflow. I'm able to do that now using more custom workflow elements with localStorage. Would be cool if that could be done out of the box.
0 -
@PairinMason How has this developed? Will this be available?
0
Please sign in to leave a comment.
Comments
3 comments