@GSA wrote:
I have the following functions:
function refreshText(xhr, status, args) { updateNodeText(args.key, args.newText); save(); } function updateNodeText(key, newText){ var nodeData = myDiagram.findNodeForKey(key).data; console.log("Old text: " + nodeData.text); nodeData.text = newText; console.log("New text: " + nodeData.text); }
Essentially this makes sure the text in the node is updated, and saves the diagram to the backend. However, it doesn't redraw the text on the node itself visually even though the model is updated (confirmed through the logs).
I have a load function:
function load() { GetModel(); setTimeout(layout, 1000); } function layout() { myDiagram.layoutDiagram(true); }
If I call this the node will be redrawn due to the layout reorganizing itself. However, I want to make the text visually update without actually rearranging the layout. How could I accomplish this?
Footnote: Running GetModel(); alone just clears the diagram completely, I have to run layout() to make it visually appear again. The reason for the timeout is to make sure backing bean calls have finished before trying to redraw the layout.
Posts: 8
Participants: 2