Attribute table widget allowing delete records

4482
14
Jump to solution
07-23-2014 01:25 PM
RhettZufelt
MVP Frequent Contributor

I am using the FV3.6 with the EditWidget and AttributeWidget.  I have the edit widget to only allow attribute updates, no add or delete features, no merge, update, geometry, nothing but <updateattributes>true</updateattributes>.

In the edit widget it appears to honor it.  If I have the edit widget open and click on a feature, the popup allows me to modify the attributes that I have configured, and nothing else.  If the edit widget is open, and I expand the table from the attribute table widget, I can also modify the attributes directly, but only if the edit widget is open (on editable feature layers).  Fine, this is what I was expecting to see.  However, if I have a feature selected in the edit widget, the attribute table widget gives me the option to "Delete Selected features", and if selected WILL delete the feature, even though the edit widget is set to not allow that.

So, where does the attribute table widget get it's options of what it is allowed to do?  Is there a way to make it honor the layer settings so that it is not possible to delete a feature from the attribute table widget?

Also, when I select a feature with the edit widget, it will also select that feature in the attribute table, which is nice.  However, now and then, it doesn't work, and I need to close/re-open the edit widget one to many times (sometimes a refresh of viewer) before it works like that again, and will just select in the edit widget, and not pass the selection on to the attribute table widget.  Any ideas as why this is happening and/or how to fix?

Thanks for any help,


R_

0 Kudos
14 Replies
DanielSmith
Occasional Contributor III

never mind i figured it out.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rhett,

  Could you not add additional conditioning to the visible syntax?

  1. <s:HGroup id="deleteSelectionGroup"   
  2.     width="100%"   
  3.    buttonMode="true"   
  4.    click="deleteSelectionGroup_clickHandler(event)"   
  5.    enabled="{dataGrid.selectionLength &gt; 0}"   
  6.    includeInLayout="False"   
  7.    verticalAlign="middle"   
  8.    visible="{showDeleteOption && SomeContitionLikeLayerName}">
RhettZufelt
MVP Frequent Contributor

Robert,

Thought about that, but would have to re-compile if I wanted to include/exclude services in the future, and I only have access to FlashBuilder now on occasion.

Would like to have that as part of the widget config.xml so could be set for each layer, but am not sure how to give the skin access to the configXML.  If it was in the basewidget, I'd just bring it in from the configXML as I am familiar with that.

R_

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rhett,

  The skin does have access to the host component which is the AttributeTable but that does not help you get back to the AttributeTableWidget where you could read the xml. I can think of a possible avenue I would go down if I had this requirement. In the AttributeTableWidget each tab in the widget is an AttributeTable that is created programmatically. You could try:

attributeTable.setStyle("something" , "Yourvalue from the xml");

then in the skin use hostComponent getStyle and see if you can read that style value.

RhettZufelt
MVP Frequent Contributor

So, at first I thought that the <sublayer iseditable="false"> should remove the delete selected features, but it didn't seem to make a difference, but seems to be working now.  So, if I set the iseditable to false for a particular sublayer, when that layer has a selection in the attribute table, the delete option is no longer shown (though, I can no longer edit the attributes either....).

Would be nice if there were a way to not allow "geometry" edits within the Attribute Table (like you can in the Edit widget) so only the attributes can be changed.  For now, I just made all of them "not" editable in the attribute table, but set to edit attributes only in the Edit widget.

R_