NodeSelectionAdornmentTemplate and nodeHoverAdorment compatibility

I have used 2 things within a same diagram :

  1. Node Selection Adornment template

  2. Node hover adornment :

and in the main diagram i have used it like :

But what’s happening is that hover adornment is working fine, i.e. on hover a button is displayed whereas selectionAdornment is not working. It’s neither highlighting the node, nor triggering the function called on select change. Is it something like that we cannot use both together ?

FYI - Selection adornment was working before i used hover adornment in the project.

Thanks ,

What happens when you drag-select the node, or Ctrl-A to selectAll?

When the hover adornment is shown, guess what gets the click event?

On Ctrl+A all the adornments are shown. Click event is triggered on the click of button which appears on hover of node. But the requirement is button click event triggers something else and node select triggers something else. And the two are different.


Yes, selection and hover events are different, and you have demonstrated that they both seem to be working correctly. So could you please analyze and describe your problem more carefully and precisely?

Hi Walter,

So, the problem is that Selection event is not working as expected. I have used a function as onSelectChange which is not getting triggered since the time i have added hover functionality.
That onSelectChange was working before i used hoverAdornment in my project.

So are you saying the problem is that calling CommandHandler.selectAll or or changing Part.isSelected to true is not calling your Part.selectionChanged event handler or your “ChangedSelection” DiagramEvent listener?

Also, if i click on a node it’s not appearing to be selected. (No blue selection adornment)
And, if i do Ctrl+A then nodes appear to be selected

  1. (When ctrl+a)

  2. image (When ExperianUS Consumer is deliberately clicked.)


Is your hover adornment showing before you click? If so, why don’t you have a click event handler like the Hover Buttons sample does? Buttons that show on Hover

Yes, Hover adornment is shown before i click the node.
I actually want to have both functionalities.

  1. On hover of node, i get a button, on click of which i make a REST call for another tree.
  2. On clicking of node opens up a box showing the logs for that particular step.

So the above sample alone cannot be used for my use-case.


Why not? Try it.

Thanks a lot!
That helped.