Select to view content in your preferred language

Attribute inspector not editable?

3410
1
Jump to solution
09-11-2014 02:17 PM
ionarawilson1
Regular Contributor II

I have an application that is using the editor and the attribute inspector. I need to add a string showing the current date to a field. Everything works but after creating the feature and selecting it again I can see the string in that field in the attribute inspector but the attribute inspector is not editable anymore for that feature. Is it possible to add a string to a field and still have that feature editable in the attribute inspector? Thanks

var    currDateTime:String = ""

private function drawEnd(event:DrawEvent):void

   {

                dateFormatter.formatString = 'YYYY/MM/DD HH:NN:SS';

                var dtCurrent:Date = new Date();               

               currDateTime = String(dateFormatter.format(dtCurrent) + '.' + dtCurrent.getMilliseconds());     

               myFeatureLayerstewardship.addEventListener(FeatureLayerEvent.EDITS_STARTING, editsStartingHandler); 

      

           

    }

               

            private function editsStartingHandler(event:FeatureLayerEvent):void

            {

                if (event.adds)

                {

                   

                    event.adds[0].attributes['DrawDate']  =  currDateTime;

                }

               

           

            }

           

           

0 Kudos
1 Solution

Accepted Solutions
ionarawilson1
Regular Contributor II

I fixed the issue! Just create a editscomplete event and refresh the feature layer and the attribute inspector!

protected function myFeatureLayerstewardship_editsCompleteHandler(event:FeatureLayerEvent):void

    {

               

                myFeatureLayerstewardship.removeEventListener(FeatureLayerEvent.EDITS_STARTING, editsStartingHandler);

       

              myFeatureLayerstewardship.refresh();

              myEditor.attributeInspector.refresh();

}

View solution in original post

0 Kudos
1 Reply
ionarawilson1
Regular Contributor II

I fixed the issue! Just create a editscomplete event and refresh the feature layer and the attribute inspector!

protected function myFeatureLayerstewardship_editsCompleteHandler(event:FeatureLayerEvent):void

    {

               

                myFeatureLayerstewardship.removeEventListener(FeatureLayerEvent.EDITS_STARTING, editsStartingHandler);

       

              myFeatureLayerstewardship.refresh();

              myEditor.attributeInspector.refresh();

}

0 Kudos