Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

So i post my question here because it didnt recieved any answers on Stackoverflow.

Hello i have some difficulties, Let me see what i want to do with some pictures and code:

I want to add some features with the edit widgets, when i do i get this:

enter image description here

But i need to get: add attachment under 'oprmerking',

When i click on the one i just added, i get to see the add attachment button, but i need to add the attachment when i create the new object: This is a picture of it:

enter image description here

There you see the show attachment, and there you can, if there is no attachment, add an attachment.

Also, when i sometimes press one of the functions, or another widget, and i click on the little green thing and only this shows: this is weird right?

enter image description here

Anyways, maybe you know what i'm doing wrong, here's some of my code from the

private function createFieldInspectors(editableLayerName:String,

editableLayerFieldNames:Array, 
editableLayerFieldLabels:Array,

editableLayerHiddenFields:Array):void

{

 editor.attributeInspector.formFieldsOrder =

 "fieldInspector";
 var layer:Layer;
 var fLayer:FeatureLayer;
 layer = map.getLayer(editableLayerName);

 //if layer is null, you entered the wrong name in the layername tag of the specific   editablelayer
 if(!layer) return;
 fLayer = layer

 as FeatureLayer;
 var field:FieldInspector;
 var fieldHidden:FieldInspector;
 // Setup FieldInspectors for visible fields
 // Assumption: both editableLayerFieldNames and editableLayerFieldLabels will have the  same number of elements
 for (var i:Number = 0; i < editableLayerFieldNames.length; i++)
 {

 field =

 new FieldInspector();
 field.featureLayer = fLayer;

 field.fieldName = editableLayerFieldNames[i];

 field.label = editableLayerFieldLabels[i];

 editor.attributeInspector.fieldInspectors.push(field);

 }

// Setup FieldInspectors for hidden fields
for (var j:Number = 0; j < editableLayerHiddenFields.length; j++)
{

fieldHidden =

new FieldInspector();
fieldHidden.featureLayer = fLayer;

fieldHidden.fieldName = editableLayerHiddenFields[j];

fieldHidden.visible =

false;
editor.attributeInspector.fieldInspectors.push(fieldHidden);

}

}





var editablelayers:XMLList = configXML.editablelayers as XMLList;
var editableLayerFieldNames:Array;
var editableLayerFieldLabels:Array;
var editableLayerHiddenFields:Array;
for each(var eLayer:XML in editablelayers.children())
{

if (eLayer.fieldnames.length() > 0)
{

// add field names to array
editableLayerFieldNames = [];

const tempFieldArray:Array = eLayer.fieldnames.split(",");
for (var count1:Number = 0; count1 < tempFieldArray.length; count1++)
{

editableLayerFieldNames.push(tempFieldArray[count1]);

}

}

if (eLayer.fieldlabels.length() > 0)
{

 // add field labels to array
editableLayerFieldLabels = [];

 const tempLabelArray:Array = eLayer.fieldlabels.split(",");
for (var counter2:Number = 0; counter2 < tempLabelArray.length; counter2++)
{

 editableLayerFieldLabels.push(tempLabelArray[counter2]);

 }

}

if (eLayer.fieldlabels.length() > 0)
{

// add names of hidden fields to array
editableLayerHiddenFields = [];

const tempHiddenFieldArray:Array = eLayer.hiddenfields.split(",");
for (var count3:Number = 0; count3 < tempHiddenFieldArray.length; count3++)
{

editableLayerHiddenFields.push(tempHiddenFieldArray[count3]);

}

}

  createFieldInspectors(eLayer.layername,editableLayerFieldNames,editableLayerFieldLabels,editableLayerHiddenFields);

}

}

 map.addEventListener(MapEvent.LAYER_ADD, mapLayerAddHandler,

 false);
 map.addEventListener(MapEvent.LAYER_REMOVE, mapLayerRemoveHandler,

 false);
 map.addEventListener(MapEvent.LAYER_REORDER, mapLayerReorderHandler,

 false);
 map.infoWindow.addEventListener(Event.CLOSE, infoWindowCloseHandler);

 AppEvent.dispatch(AppEvent.DATA_OPT_LAYERS,

 null, getOplayers);
 mapLayers = map.layers

 as ArrayCollection;
 arrLayers = getLayers(mapLayers);

 // get all the layers on map except basemap layers;
 populateEditor(arrLayers);

 }

And here's my xml:

<?xml version="1.0" ?>
<!-- If compiling this widget, make sure to add -keep-all-type-selectors=true to your compiler arguments in the FB project properties. -->

    <configuration>
    <createoptions>
      <polygondrawtools>polygon,freehandpolygon,extent,autocomplete,circle,ellipse</polygondrawtools>
     <polylinedrawtools>polyline,freehandpolyline,line</polylinedrawtools>
    </createoptions>
    <addfeatures>true</addfeatures>
    <deletefeatures>true</deletefeatures>
    <updateattributes>true</updateattributes>
    <updategeometry>true</updategeometry>
    <toolbarvisible>true</toolbarvisible>
    <toolbarcutvisible>false</toolbarcutvisible>
    <toolbarmergevisible>false</toolbarmergevisible>
    <toolbarreshapevisible>false</toolbarreshapevisible>
    <editablelayers>
    <editablelayer>
    <layername>Bomen</layername>
    <fieldnames>Datum_Opname,Afstand_Tot_Hart_Spoor,Kilometer,Diameter,Type,Toestand,Status,Opmerking</fieldnames>
    <fieldlabels>Datum Opname,Afstand Tot Hart  Spoor,Kilometer,Diameter,Type,Toestand,Status,Opmerking</fieldlabels>
    <hiddenfields>OBJECTID</hiddenfields>
    </editablelayer>
    <editablelayer>
    <layername>Sloten</layername>
    <fieldnames>Waterschap,Jaar,GEMEENTE,EIGENAAR,Gereed,Datum_Gereed,Opmerking</fieldnames>
    <fieldlabels>Waterschap,Jaar,Gemeente,Eigenaar,Gereed,Datum Gereed,Opmerking</fieldlabels>
    <hiddenfields>OBJECTID</hiddenfields>
    </editablelayer>
    </editablelayers>
    <excludelayer>Infrabeheerder</excludelayer>
    <excludelayer>Spoortoegang</excludelayer>
    <!-- dit was in de comments tot showeditdatefield -->
    <formfieldsorder>fieldInspector</formfieldsorder>
    <showcreatorfield>true</showcreatorfield>
    <showcreationdatefield>true</showcreationdatefield>
    <showeditorfield>true</showeditorfield>
    <showeditdatefield>true</showeditdatefield>
    </configuration>

EDIT

I Fixed the problem when the popup didnt had any attributes that was because of the property, the problem i need to fix is with the add attachment when i add all the attributes, or maybe an option to hide the layers, because when i turn off the excludelayer i get to see all the layers. Any help would be appreciated

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.