Deselecting Item in Palette

Hey guys, I’ve been using the Flowgrammer (GoWeb) to make a proof of concept to see how usable letting our users make charts on the website would be. So i’m trying to deselect the item in the palette when the user adds it to the chart. I can remove it from the selection so it wont be added again (we’ll be adding custom properties and making them deselect it in the palette to go change a property would confuse them), but i cant make the green border go away. I imagine its simple but i cant find a property that looks like it will turn it off, i had assumed that once it wasnt selected anymore it would just be handled. I’ve tried all of the following and then some at one point or another.

//this.MyPalette.HidesSelection = true; this.MyPalette.Selection.Select(null); // this.MyPalette.DoSelectionDropped(new GoInputEventArgs());
// this.MyPalette.SelectInRectangle(new RectangleF(0F, 0F, 1F, 1F));
// this.MyPalette.Selection.Select(MyPalette.Document.DefaultLayer.NextObject(MyPalette.Selection.Primary, 1));
the second to last one was fun, it moved the selection down through the palette every time i clicked.
Any ideas and help would be appreciated


How is this code getting executed? I’m just thinking that the image for your palette isn’t being reloaded, even though on the server the selection has changed just as you expected.

The selection in the palette is happening is a key part of how the drag-drop works in Goweb. Instead of getting rid of the selection itself, it may be easier to get rid of the visual aspect of the selection.

The easiest way to do that is set PrimarySelectionColor on the palette to the same as the background color.

Or, you could override AddSelectionHandles on the selection object of the node and no-op it if the node is in a GoPalette.

I have both the palette and the chart in the same asp:updatepanel. I dont think adding that caused the issue, because i was seeing the same behavior without it. I’m calling myPalette.UpdateView(); If I have

this.MyPalette.Selection.Select(MyPalette.Document.DefaultLayer.NextObject(MyPalette.Selection.Primary, 1));
in the click event, each time i click in the chart i get a new node of the next type moving down the palette, but the displayed selection wont change.
I thought about changing the selection color, but i think i should show the user what is selected, for usability reasons, same reason i want to de select it. I dont want a new node added everytime they click since i'll be adding custom properties and things that will need to be editied. Is there a way i can force whatever event fires when i click the BG of the palette?

When the main GoView is updated, the palette isn’t. Only on a drag-drop are both updated (GoWeb.js does this). Calling UpdateView doesn’t push bits to the client… the client has to pull them.

But…you should be able to to write a client side click event that updates the palette. Look at the Client side event handling section of GoWebIntro. and take a peek at goweb.js.