Select to view content in your preferred language

EditWidget 2.5 UpdateFeature tag doesn't work

1515
11
02-07-2012 06:19 AM
FabianMejia
Deactivated User
good morning. i've tried flex viewer 2.5 and i found an issue when setting 'updategeometry' tag to false, it seems not to work. it still let me update geometries.

looking at EditWidget.mxml code, everyting is ok:
 
...
//updateGeometry
if (configXML.updategeometry.length() > 0)
{
      updateGeometry = configXML.updategeometry == "true";
}
editor.updateGeometryEnabled = updateGeometry;
....


tanks, i wait for yours answers.

Fabian Mejia
frmejiao@dane.gov.co
Tags (2)
0 Kudos
11 Replies
BjornSvensson
Esri Regular Contributor
Hola Fabian,
It seems to work fine for me.

I took the provided default one and just changed the updategeometry value:

<?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 label="Edit (example)">
    <createoptions>
        <polygondrawtools>polygon,freehandpolygon,extent,autocomplete</polygondrawtools>
        <polylinedrawtools>polyline,freehandpolyline,line</polylinedrawtools>
    </createoptions>
    <addfeatures>true</addfeatures>
    <deletefeatures>true</deletefeatures>
    <toolbarvisible>false</toolbarvisible>
    <toolbarcutvisible>false</toolbarcutvisible>
    <toolbarmergevisible>false</toolbarmergevisible>
    <toolbarreshapevisible>false</toolbarreshapevisible>
    <updategeometry>false</updategeometry>
    <updateattributes>true</updateattributes>
</configuration>


It also works if I try the minimum one:
<?xml version="1.0" ?>
<configuration>
    <updategeometry>false</updategeometry>
</configuration>


What does your file look like?
Are you sure it is the same that is being referenced in the config.xml file?
Did you empty your browser cache and/or try from different browser or machine to make sure it is not a problem with browser caching?
0 Kudos
FabianMejia
Deactivated User
hi Bjorn, tanks for reply.

So as you, I took the default xml and changed only "
updategeometries
" tag to
false
. first it seems work fine, but when i select one feature and click it twice it let me edit geometries.

Also I started a debug session on my FlashBuilder, put two or tree break points on this lines

//.....EditWidget: basewidget_widgetConfigLoaded function...

//updateGeometry
if (configXML.updategeometry.length() > 0)
{
     updateGeometry = configXML.updategeometry == "true";
}
editor.updateGeometryEnabled = updateGeometry;

//labels
attributesLabel = configXML.labels.attributeslabel[0] || getDefaultString("attributesLabel");

//...continue.....


in
attributesLabel  = configXML.labels.attributeslabel[0] || getDefaultString("attributesLabel");
asigment line, I watched "
editor.updateGeometryEnabled
" and its value was "false", thats is ok. but again, when selected and clicked any feature twice still let me edit geometries 😞

Attach 2 videos. first shows my debug session and second one is an edition screen capture (with
<updategeometry>false</updategeometry>
).

thanks again.

Fabian Mejia
0 Kudos
SteveDuquette
Occasional Contributor
Hi

I am facing the same issue...any luck on this?

Steve Duquette
Parks Canada
0 Kudos
BjornSvensson
Esri Regular Contributor
Does the same problem occur in version 3.0?
0 Kudos
SteveDuquette
Occasional Contributor
Hi Bjorn...

This is in 2.5

I am not able to run 3.  Tried it and it won't even display a tiled map...maybe it's because we are still using 10 and not 10.1 for our server side services...or something else...i've been using flex for some time and it's the first time I've encountered something like this (version 3 refusing to run)...I've downloaded everything again today (I was hoping version 3 would not do this)...the flex viewer and the flex api...referenced the API swf in the project....put in a 10.0 web tiled service...and won't work...pretty basic...don't know what I am doing wrong!

Steve
0 Kudos
BjornSvensson
Esri Regular Contributor
I am not able to run 3.  Tried it and it won't even display a tiled map...maybe it's because we are still using 10 and not 10.1


All versions of the Flex API (from 1.0 to 3.0) all work with any ArcGIS Server 9.3 and later.  So your problem with 3.0 must be related to something else.  My recommendation would be to try and figure out why 3.0 isn't working...  If you still have problem with it, you might want to create a new thread for that issue.
0 Kudos
SteveDuquette
Occasional Contributor
Hi Bjorn

Well I figured out the 3.0 thing...I was not using the 4.6.0 SDK...so now the flex viewer 3.0 is working.

BUT

I still have the same issue.  I wan't my users to only be able to edit the attributes and not the geometry...so if I go in the xml of the edit widget (EditWidget.xml) and I set it up like this:

<addfeatures>false</addfeatures>
    <deletefeatures>false</deletefeatures>
    <toolbarvisible>true</toolbarvisible>
    <toolbarcutvisible>false</toolbarcutvisible>
    <toolbarmergevisible>false</toolbarmergevisible>
    <toolbarreshapevisible>false</toolbarreshapevisible>  
    <updategeometry>false</updategeometry>
    <updateattributes>false</updateattributes>
    <showcreatorfield>true</showcreatorfield>   
    <showcreationdatefield>true</showcreationdatefield>   
    <showeditorfield>true</showeditorfield>   
    <showeditdatefield>true</showeditdatefield>

Where I put extra attention on updategeometry - set to false....in the app I still can edit the geometry...and same goes for the deletefeatures...

I hope you can give me a hand...cause this issue is still the at 3.0

Steve Duquette
0 Kudos
SteveDuquette
Occasional Contributor
Bjron

Me again

I think the xml is not being read or at least the variables are not being fed the value of the xml.  if i go in the mxml and change the following:

private var addFeatures:Boolean = false;
private var deleteFeatures:Boolean = false;
private var updateGeometry:Boolean = false;
private var updateAttributes:Boolean = true;

Seems to do the trick...and the delete option is gone as well.

Steve
0 Kudos
SarthakDatt
Frequent Contributor
Hey Steve,

I tried it on my end with 3.0 viewer and it works as expected. Just wanted to confirm this, the out-of-the-box Edit widget's config has evrything commented out(we wanted to keep all the properties true by default), have you removed the comments? If not the changes won't take effect.

<?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>
    <!--  // remove this
    <createoptions>
        <polygondrawtools>polygon,freehandpolygon,extent,autocomplete</polygondrawtools>
        <polylinedrawtools>polyline,freehandpolyline,line</polylinedrawtools>
    </createoptions>
    <addfeatures>true</addfeatures>
    <deletefeatures>true</deletefeatures>
    <toolbarvisible>true</toolbarvisible>
    <toolbarcutvisible>false</toolbarcutvisible>
    <toolbarmergevisible>false</toolbarmergevisible>
    <toolbarreshapevisible>false</toolbarreshapevisible>   
    <updategeometry>false</updategeometry>
    <updateattributes>false</updateattributes>    
    --> // remove this
</configuration>
0 Kudos