POST
|
Hi guys, Help needed on creating composite components for customField in the fieldInfo object. I am creating AttributeInspector for a feature class. Esri has a sample that using single dijit component (dijit.form.ValidationTextBox) as a customField. see the example. What I want is to create a customized dijit component which includes two default dijit components: a TextBox and a Button. See the screen shot from the AttributeInspector . In the screen shot, I want to have two components for the Full Road Name: the TextBox for the attribute information, and the Button will do another thing based on the TextBox value. I created a customized dijit which includes those two components. But I don't know how to have my customized components read the value from the field of a table like other attributeInspector fieldInfo components. Thanks for help. Mike
... View more
12-15-2015
05:52 AM
|
0
|
0
|
1824
|
POST
|
Kelly, I think that I found the situation that the event listener is not fired. First, the targeted FeatureLayer is one layer of a FeatureServer. We have noticed that this FeatureServer is not running fast. Every pan of the map will take a while for the data on the FeatureServer to redraw. To increase the performance of the FeatureServer, we have set the scale dependence. This data will not be visible until the map is zoomed into about 4K. Basically, the FeatureServer data will be available at scale of 4k, 2k, 1K (the ESRI's universal scale for caching). Secondly, the situation of not-firing the "before-apply-edits" or "graphic-add" event listener is like this: if the map is panned (intentionally or not) during the digitization, the data from the FeatureServer have to reload and the reloading is not fast for FeatureServer. This is the reason why the event listener is not fired. If the map is not panned during the digitization, the designated event listener works well. So, why do the map panning and/or FeatureServer data reloading cause the "graphic-add" and/or the "before-apply-edits" event listeners not working? Thanks for your advice. Mike
... View more
09-01-2015
12:12 PM
|
0
|
1
|
647
|
POST
|
As the code is very long. I just copy the segments that are for this purpose. The code segment for templatePicker and Editor: templatePicker = new TemplatePicker(templateParam, "templateDiv"); templatePicker.startup(); templatePicker.on("selection-change", templateValidate); templatePicker.clearSelection(); aEditor = new Editor(editor_params, 'editorDiv'); The code segment to define the event listener. templateValidate : function(evt) { selectedTemplate = this.getSelected(); LAYER_NAME = selectedTemplate.featureLayer.id; if (LAYER_NAME == "myRdLayer" ) { hdlrGrpAdded_rd = on("before-apply-edits",updateAttribute_rd); } }, The code segment of the event listener. updateAttribute_rd : function(evt){ var dt = convert_js_time_to_sqlserver( String(new Date()) ); // check the edits is about adding, deleting, or updating var bDelete = !($.isEmptyObject(evt.deletes)); var bAdd = !($.isEmptyObject(evt.adds)); var bUpdate = !($.isEmptyObject(evt.updates)); // end of check editing status var gg; if (bAdd){ console.log("Before a road is created, update road info. Time: " + new Date()); gg = evt.adds[0]; gg.attributes["LASTUPDATE"] = dt; gg.attributes["LASTEDITOR"] = UserName; gg.attributes["STCOFIPS"] = CNTY_ID; gg.attributes["STATENAME"] = StateName; gg.attributes["STATERIGHT"] = StateName;; gg.attributes["FROMLEFT"] = 1; gg.attributes["FROMRIGHT"] = 2; gg.attributes["INWATER"] = "No"; gg.attributes["ONEWAYDIR"] = "From-To"; SAMS.srvlyrSams_roadCenterLn.applyEdits([gg], null, null, EditNew_Success, error2); } if (bDelete){ console.log("Delete a road. Time: " + new Date()); } if (bUpdate){ console.log("Update a road. Time: " + new Date()); } },
... View more
09-01-2015
11:47 AM
|
0
|
0
|
647
|
POST
|
Kelly, thanks for your reply. I am using TemplatePicker widget and Editor widget. I have figured out how to apply "before-apply-edits" event. But, the designated event listener is not fired at some cases, too. This problem is the same as "graphic-add" event. The problem happens after double-click to finish the sketch, if the progress bar on the Editor widget shows up, both event listeners will not be fired and the attached attributeInspector popup without any attribute updating. If the progress bar does not show up, both event listeners will be fired and the attached attributeInspector popup with the updated attribute information. If the progress bar show up, it will take a while (in seconds) for the digitized sketch to show up. Since the event listeners are designed for their corresponding event, they should be fired no matter how long it takes for the edits to be applied. I don't know why the event listeners are not fired if the progress bar shows up. Thanks for your help. Mike
... View more
09-01-2015
09:38 AM
|
0
|
4
|
647
|
POST
|
Kelly, thanks for the reply. I am not sure how to listen to "before-apply-edits" event. When I use the "graphic-add" event, my scenario is as follows: (1) choose a template from the TemplatePicker widget. (2) digitize a graph on the map. Since the graph is based on selected template, I suppose the graph is added to the template's corresponding featurelayer once the sketch is finished. Is this understanding right? (3) listen to the "graphic-add" event and update the attribute information. If I listen to the "before-apply-edits" event, how should I listen to this event based on my workflow? Thanks, Mike
... View more
09-01-2015
06:36 AM
|
0
|
6
|
647
|
POST
|
Hi, I have added a FeatureLayer to my web map for online editing. I have also set an event listener to the "graphic-add" event. I use the Editor widget and the TemplatePicker widget. I first choose a template from the TemplatePicker, and then digitize a graph on the map. The plan is to call a function to update the attribute information after the graph is added to the featurelayer. myEditingFLayer.on("graphic-add", updateGrpAttribute); updateGrpAttribute : function(evt){ var gg = evt.graphic; gg.attributes["UserName"] = userName; gg.attributes["LASTUPDATE"] = updateTime; gg.attributes["CntyFips"] = CNTY_ID; gg.attributes["CAPTUREMETH"] = "Placed on Map"; myEditingFLayer.applyEdits(null, [gg], null, EditNew_Success, error); } But, this handler is not consistently fired. If I see the progress bar displays, the designated event handler will not be executed. Please advise. Thanks, Mike
... View more
08-31-2015
01:49 PM
|
0
|
8
|
3345
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|