laptop and a wrench

Bug

Toolbar::CurrentTool returns an empty string when in callback request/response.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM006759
SubmittedFebruary 12, 2007
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.2
Program languageC#
StatusWill Not Be Addressed

Additional Information

No Public Explanation

Workaround

When click any tool in toolbar, execute a Javascript to send a callback request to the server with the current tool name. And save the string in a session variable. In the future the current tool name could be retrieved from the session variable. Here is the code:Client side Javascript: function currenttool() { toolbar = Toolbars["Toolbar1"]; var f = document.form1; var mod = f.elements[toolbar.currentToolField].value; return mod; } function manuallyCallbackrequest() { var message = currenttool(); var context = null; <%=sCallbackInvotion%> }Server side code:public partial class _Default : System.Web.UI.Page, ICallbackEventHandler{ public string sCallbackInvotion; protected void Page_Load(object sender, EventArgs e) { sCallbackInvotion = Page.ClientScript.GetCallbackEventReference(this, "message", "processCallbackResult", "context", "postBackError", true); } protected void Map1_MapClick(object sender, ESRI.ArcGIS.ADF.Web.UI.WebControls.PointEventArgs args) { if (Session["currentToolName"] != null) { System.Diagnostics.Debug.WriteLine(Session["currentToolName"].ToString()); } } #region ICallbackEventHandler Members public string GetCallbackResult() { return null; } public void RaiseCallbackEvent(string eventArgument) { Session.Add("currentToolName", eventArgument); } #endregion}

Steps to Reproduce

Bug ID: NIM006759

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options