Attribute Inspector Modification Issue

779
8
11-03-2011 12:39 PM
PatrickAdesso
New Contributor
Hi all,

I'm trying to use the attribute inspector as an item renderer in a datagrid.  I've gotten the fieldInspector components filtered down properly to only show data for the grid column they're in and they editing is working properly but I'm having some trouble getting them to a look just right.

Basically, I can't get rid of the label in the AttributeInpector form, so the cell is overflowing.  Ideally, I'd like to only use the Field Inspector component as the itemRenderer but that doesn't inherit from IDisplay, so I can't add it directly.

I set a custom skin on the AttributeInspector and got it formatted the way I want minus the label.  Since the child Form object is a halo object, I can't nest a skin on there and dump the label...

It seems to me, the right way would be to override the AttributeInspector object and have a container (BorderContainer?) instead of a form but I can't get this to work either.

Any insight is appreciated.

Patrick
Tags (2)
0 Kudos
8 Replies
PatrickAdesso
New Contributor
Sorry to bump this but I don't want it to fall too far; I could really use a nudge.

Does anyone know how to use a UI component besides a form in an attribute inspector?
0 Kudos
IvanBespalov
Occasional Contributor III
1 - Can you show your AttributeIspector skin code?

2 - Why u can not use some own GridItemRenderer instead of AttributeInspector?
0 Kudos
PatrickAdesso
New Contributor
Thanks for the response!

Skin code is just the default skin as the form is a halo (mx) component, so I can't control children of that it seems.
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (c) 2010 ESRI

     All rights reserved under the copyright laws of the United States
     and applicable international laws, treaties, and conventions.

     You may freely redistribute and use this sample code, with or
     without modification, provided you include the original copyright
     notice and use restrictions.

     See use restrictions in use_restrictions.txt.
-->
<!---
     The default skin class for the AttributeInspector component.
-->
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:mx="library://ns.adobe.com/flex/mx"
             xmlns:s="library://ns.adobe.com/flex/spark">

    <!-- host component -->
    <fx:Metadata>
        /**
         * A strongly typed property that references the component to which this skin is applied.
         */ 
        [HostComponent("com.esri.ags.components.AttributeInspector")]
    </fx:Metadata>

    <s:states>
        <s:State name="normal"/>
        <s:State name="disabled"/>
        <s:State name="invalid"/>
    </s:states>

    <s:layout>
        <s:VerticalLayout horizontalAlign="center"/>
    </s:layout>

    <!--- Form to display the attributes of the active feature. -->
    <mx:Form id="form"
    paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0"    
             width="100%" height="100%"
             enabled.disabled="false"
             horizontalScrollPolicy="off"  
             maxHeight="{hostComponent.getStyle('formMaxHeight')}"
             verticalScrollPolicy="auto">
        <mx:FormHeading includeInLayout="{hostComponent.numFeatures&gt;1}"
                        label="{hostComponent.activeFeatureIndex+1} {resourceManager.getString('ESRIMessages','attributeInspectorOf')} {hostComponent.numFeatures}"
                        visible="{hostComponent.numFeatures&gt;1}"/>
    </mx:Form>
    
</s:SparkSkin>


I'd be happy to use another grid renderer if it worked properly.  I guess I could bind the coded values in the feature layer to a dropdown directly instead of using the attribute inspector??  I opted for the attribute inspector because it's simple to do the update (editting attribute values) using the applyEdits method.  I'm open to suggestions!
0 Kudos
PatrickAdesso
New Contributor
Anybody? 

How can I add a fieldInspector to an itemRender or how can I get rid of the Form in the AttributeEditor skin?
0 Kudos
TroySchmidt
New Contributor
I have the same question Patrick.
0 Kudos
PatrickAdesso
New Contributor
Surely someone with ESRI has input...  Are we forced into using a form (child of the attribute Inspector) as a container for a field inspector?

Maybe a better question...  How can a field inspector be added to a generic UIComponent?  Do we need to set a renderer if we are doing in manually?  Is the renderer defaulted somehow if we use an attributeInspector?

Help! 🙂
Patrick
0 Kudos
TroySchmidt
New Contributor
I just hope someone from ESRI sees this and can give some help.
0 Kudos
IvanBespalov
Occasional Contributor III
Patrick,
If I had a task to create a DataGrid with the ability to edit and save changes, then I would start something like this.
I can change Incident number and track changes. I know, how to apply edits.

Source is here (4KB).
0 Kudos