How would I strip an '&' symbol out of an ESRI dropdown before any of its default control logic is run?
I have an ESRI dropdown control inside of an ESRI toolbar. One of the items in the dropdown needs to have an '&' symbol in it. As it turns out ESRI stuff builds its callb开发者_运维问答ack strings as & delimited strings, so when an item is selected the parent toolbar immediately builds and handles the callback string. At one point it splits strings based on the '&' crashing the app.
In effect, having an ampersand in an esri dropdown causes nasty stuff to happen when you select the item.
What I need to do is find out how I can hop in before the callback stuff starts happening and strip that & out. I was thinking that perhaps I'd have to create a custom esri toolbar control, but I'm not sure and that'd be pretty undesirable.
Any ideas?
Welp. I went with a different approach if anyone is curious...
The callbacks are built off the dropdown item value whereas dropdown item names are what is displayed to the user. So, I set the name to be the one with the ampersand and the value to be the one without.
This requires some special checks at a couple of points, but overall the hack isn't too intrusive.
精彩评论