Possible to edit InfoWindow of the editor?

336
7
Jump to solution
06-01-2012 06:32 AM
SachaTousignant
New Contributor III
Hello everyone,

I'm still new to FLEX + ArcGis API for Flex and I'm currently trying to modify the InfoWindow which pops when you click on a feature in the map from a feature layer.
For example, I'd like to modify the labels, the order and the enabled of the attributes.

If you need more info/code, lmk!

Ty
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SachaTousignant
New Contributor III
I succeed to find my answer. Here's the code, hope this will help someone else.
Don't forget to + me ! =)

var fieldInspector10:FieldInspector = new FieldInspector(); fieldInspector10.featureLayer = featureLayerFiche; fieldInspector10.fieldName = "OBJECTID"; fieldInspector10.label="Label : "; fieldInspector10.enabled=true; fieldInspector10.toolTip="Tooltip text";           var attributeInspector: AttributeInspector = editorFiche.attributeInspector; attributeInspector.featureLayers = [featureLayerFiche] attributeInspector.fieldInspectors = [fieldInspector10] attributeInspector.formItemsOrder = "fieldInspector"; attributeInspector.singleToMultilineThreshold = 100; attributeInspector.deleteButtonVisible = false; attributeInspector.infoWindowLabel = "Some text for the title";

View solution in original post

0 Kudos
7 Replies
YungKaiChin
Occasional Contributor
Not sure what exactly your question is.

If the title is your question, yes it is possible.
You can have a custom infowindow that is completely different to the default one.
Just assign it to the inforwindow.
0 Kudos
SachaTousignant
New Contributor III
Not sure what exactly your question is.

If the title is your question, yes it is possible.
You can have a custom infowindow that is completely different to the default one.
Just assign it to the inforwindow.


I forgot to say :

My current problem right now is that I'm not able to compile this code :

<esri:infoWindowContent>
            <s:BorderContainer backgroundColor="0xFFFFFF">
                <esri:AttributeInspector id="attrInsp" deleteFeature="attrInsp_deleteFeatureHandler(event)"  updateFeature="attrInsp_updateFeatureHandler(event)"/>

more code...

            </s:BorderContainer>
        </esri:infoWindowContent>


Since my .mxml contains only a widget. The map is initialized outside of it, so I get this error : Unable to resolve <esri:infoWindowContent> in a component implementation.

So I was wondering if there was a way to customize the infoWindow with my situation.

I also found this : http://www.arcgis.com/home/item.html?id=c12dfc1fbc5c49bfa21c48c809a1eaca
Which I think is a good track to resolve my problem.


Any more help would be really appreciated!
0 Kudos
YungKaiChin
Occasional Contributor
I never use the method you use there.
I don't know if it will be easier to use this method
(The method I prefer)

1. Create a new custom component
2. Assign it to myMap.infoWindow.content
3. myMap.infoWindow.show(mapPoint)
0 Kudos
SachaTousignant
New Contributor III
I never use the method you use there.
I don't know if it will be easier to use this method
(The method I prefer)

1. Create a new custom component
2. Assign it to myMap.infoWindow.content
3. myMap.infoWindow.show(mapPoint)


Will try that after, ty
0 Kudos
SachaTousignant
New Contributor III
I never use the method you use there.
I don't know if it will be easier to use this method
(The method I prefer)

1. Create a new custom component
2. Assign it to myMap.infoWindow.content
3. myMap.infoWindow.show(mapPoint)


There's a small problem with your method, it's ALOT longer and more coding...
The editor already makes the infoWindow + all the commit on the feature layer.

Isn't there another way to just be able to modify for example, the enabled of some attributes in the infoWindow?
0 Kudos
YungKaiChin
Occasional Contributor
Yes, there is another way.
Take a look at this example here:
http://help.arcgis.com/en/webapi/flex/samples/01nq/01nq0000001q000000.htm
Look at the function onMouseOverHandler in it.

My method may take a bit longer, but it is a complete custom component.
So how long it may take depends on how complex the component is.
Also, you can always take ESRI's infowindow and modify to the way you want.

Good luck,
0 Kudos
SachaTousignant
New Contributor III
I succeed to find my answer. Here's the code, hope this will help someone else.
Don't forget to + me ! =)

var fieldInspector10:FieldInspector = new FieldInspector(); fieldInspector10.featureLayer = featureLayerFiche; fieldInspector10.fieldName = "OBJECTID"; fieldInspector10.label="Label : "; fieldInspector10.enabled=true; fieldInspector10.toolTip="Tooltip text";           var attributeInspector: AttributeInspector = editorFiche.attributeInspector; attributeInspector.featureLayers = [featureLayerFiche] attributeInspector.fieldInspectors = [fieldInspector10] attributeInspector.formItemsOrder = "fieldInspector"; attributeInspector.singleToMultilineThreshold = 100; attributeInspector.deleteButtonVisible = false; attributeInspector.infoWindowLabel = "Some text for the title";

View solution in original post

0 Kudos