Skip to content

How to invoke SelectAction and CenterAction while loading graph #569

Answered by tortmayr
sathya-1994 asked this question in General
Discussion options

You must be logged in to vote

Hi @sathya-1994,
in the workflow you described the SetModelAction has no effect because it is handled before the model updates is completed on the client side (i.e. it tries to select the node before its actually rendered in the diagram).
To handle such use cases we have two different mechanisms in place:

On the client side you can queue actions until the initial diagram model is loaded using the onceModelInitialized() promise of the GLSPActionDispatcher. An example usage can e.g. found in the GLSPDiagramWidget class.

On the server side you can use the dispatchAfterNextUpdate method of the ActionDispatcher to queue an action and it gets dispatched after the next model update has been comp…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tortmayr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants