Select to view content in your preferred language

Make Fields Required in the Relationship Inspector

3766
3
02-20-2014 04:30 AM
ionarawilson1
Deactivated User
I need to make some fields required in the attribute inspector of my relationship inspector. The code I use works with the editor attribute inspector but not with the relationship inspector attribute inspector. I get an error on this  line:

    attributeInspector.fieldInspectors = [fieldInspector1, fieldInspector2]

TypeError: Error #1009: Cannot access a property or method of a null object reference.

When I use the code assist in the relationship I can see that there is a class called Attribute Inspector - Relationship Inspector (please see image), but I can't find this class to instantiate the attribute inspector in action script. Anybody know the right way to do this? Thanks


     myEditor.featureLayers = [ myFeatureLayerstewardship];
     var attributeInspector: AttributeInspector = relationshipInspector.attributeInspector
     var fieldInspector1:FieldInspector = new FieldInspector();
     var fieldInspector2:FieldInspector = new FieldInspector();
     
     fieldInspector1.featureLayer = myFeatureLayercounty
     fieldInspector2.featureLayer = myFeatureLayercounty
     attributeInspector.fieldInspectors = [fieldInspector1, fieldInspector2]
     fieldInspector1.fieldName = "Acres"
     fieldInspector1.required = true
[ATTACH=CONFIG]31610[/ATTACH]
Tags (2)
0 Kudos
3 Replies
ionarawilson1
Deactivated User
Is there anybody that could help with this? Thanks
0 Kudos
BjornSvensson
Esri Regular Contributor
Not sure if it's helpful, but have you looked at the skins for the RelationshipInspector?

  • RelationshipInspectorAttributeInspectorSkin.mxml

  • RelationshipInspectorSkin.mxml



https://developers.arcgis.com/flex/api-reference/com/esri/ags/components/RelationshipInspector.html#...
0 Kudos
ionarawilson1
Deactivated User
I did but I will look more carefully. Since the relationship inspector uses an attribute inspector I thought I could change properties in the attribute inspector, but I will try to see if I can make these kind of changes in the skins. Thanks
0 Kudos