I know this is in the WebIntro document but it doesn’t actually provide any code samples on how I can access the session object via one of the events (such as ObjectContextClicked).
What exactly are you trying to accomplish? Maybe there’s a better way…
In general, my app does three things:
1. Drag a node (always a GoBasicNode) from the palette to the diagram.
2. Immediately popup a properties window based on the node type (the labels and colors make them different, so I know which one they dragged over).
3. What they enter in the popup may change the color and/or label of the node (so I need to refresh the diagram once they click finish in the popup).
4. They may also cancel out of the popup, in which case the newly added node gets removed from the diagram.
1. The user right-clicks a node and using a context menu, I open the appropriate popup window (this works now in the WebApp but I do not know what node, ie PartID, they have selected.)
2. The user alternatively double-clicks a node to open the default properties pop-up for the node.
1. A user selects an existing node and draws a link to another node.
2. A pop-up appears asking for details about this link (and the option to cancel the creation of the link).
In all cases the “popup” is a DHTML window I open by referencing a URL on my server (an aspx page). Since I can’t edit a Session object via the GoView events, I can’t tell what the currently selected node is (via its PartID) when the pop-up window opens.
This all works in my WinApp, but I am bumping into issues with the WebApp as I juggle client-side vs. server side.
I guess, in the end, I need to know how to do three things:
- Know which node is currently selected (via their PartID) on the client-side when a node is added or selected (single or double click).
2. I need to know how to cancel the addition of a new node (or link) from the client-side (such as when the user cancels out of the popup window after adding a new node).
3. I need to know how to refresh the diagram image as a result of a change made in a popup window.