Refreshing diagram after Restful HTTP post in a context menu

Only the adornedPart prints and where I try to define ‘adorned’ do not work, because adornedPart doesn’t seem to exist.

Is rightClickMenu instanceof go.Adornment true?

Or, in your click event handler, does obj.part === rightClickMenu?

I’ll try printing it, but I do not have it set manually anywhere; I will try that if it isn’t already.

It isn’t an adornment. I will also try defining it within the node template, rather than outside.
Though I saw the second half of your question now, so I’ll check that first.

Well, if the context menu isn’t an instance of Adornment, then it’s not a GoJS context menu.

So it’s an instance of HTMLInfo? You must have redefined the “ContextMenu” builder. The HTMLInfo.show function will be passed the GraphObject on which your context menu was declared.

This turned out true. If it is the case that the builder was redefined, it was certainly unintentional and not done explicitly.

Cannot find HTMLInfo inside contextMenu; go.HTMLInfo IS visible, but doesn’t allow access to a copy/use of the show function.

Is obj.part instanceof go.HTMLInfo true?

The “ContextMenu” builder is defined at https://gojs.net/latest/extensions/Buttons.js. As you can see, it makes an Adornment. Look for calls to the static function GraphObject.defineBuilder. Or maybe you have defined a class with the name “ContextMenu”.

No calls to defineBuilder() in any of the files, and it isn’t an instance of go.HTMLInfo. Only time “ContextMenu” is even used is in a comment or the code I’ve already posted here.
GoJS is imported like:

import * as go from 'gojs';

What version of GoJS are you using? Evaluate go.version.
What is the value of obj.part.constructor? And obj.part.constructor.className?

When trying to evaluate go.version, it throws this error:
Property ‘version’ does not exist on type ‘typeof import(“c:/Users/…/node_modules/gojs/release/go”)’.

Note: I’m evaluating using console.log calls inside the click function of the context menu.

I’ve also got this error (so I’l see what they say outside of the click function):
Property ‘className’ does not exist on type ‘Function’.

I am still able to evaluate obj.part.constructor inside the click function, and get this printed:

ƒ pf(a){T.call(this,a);this.D&=-257;this.Tg=“Adornment”;this.$d=null;this.Dw=0;this.Ow=!1;this.l=[];this.Va=null}

I can try uninstalling GoJS and reinstalling, if that might clarify things.

I’m using gojs v 2.0.16
I had to check the package.json, since evaluating go.version didn’t work in other parts of the code either.

I’m having a hard time explaining this weirdness. Do you have two different GoJS libraries loaded at the same time?

The git branch would be separate from older branches that have potentially older versions of go, while go is only imported once in the component I’m working on, though I haven’t looked through the angular dependencies it is importing to see if there is a contextmenu in any of them yet.

import {
  Component,
  OnInit,
  Output,
  EventEmitter
} from '@angular/core';
import { MatDialog } from '@angular/material';
import { SafeResourceUrl } from '@angular/platform-browser';
import { Http } from '@angular/http';

I don’t expect there to be, but I’m willing to look in the off chance it is the problem.

Look in the debugger to see what files have been loaded. Unless you are using Webpack or similar to put everything into one file. Look at all “import” statements of the source files that use GoJS at all.

Does it still work for you when removing the parts within a rest call like I am trying? The reason I’ve been trying this route is because the angular calls I have to refresh the diagram are not in scope within the rest call. They are undefined only inside the post results section of code.

I haven’t tried that. I would think that a setTimeout would produce the same effect.

At the time your code writes out “SUCCESSFUL DELETE”, can you confirm that the value of adorned is correct?

The code will not compile with any reference to adorned because adornedPart doesn’t appear to exist. It is currently commented out.