I want to limit the number of characters a Flex application allows to enter into the Geocode an address box. How would I do that?
I would like for a box that looks like this to limit entry of characters to 110: Geocode an address—ArcGIS API for Flex | ArcGIS for Developers - I would like for a box like
Solved! Go to Solution.
Chris,
You can change the mxml file but then the whole AGS Viewer for Flex Source code will have to be recompiled with the change.
Chris,
You would have to copy the GeocoderSkin.mxml in the Flex API and include it in your Flex Viewer project and modify the GeocoderSkin.mxmls textDisplay
<!-- text --> <!--- @copy spark.components.supportClasses.SkinnableTextBase#textDisplay --> <s:RichEditableText id="textDisplay" maxChars="110" left="1" right="1" top="1" bottom="1" verticalAlign="middle" widthInChars="10"/>
Let me know if you are unfamiliar with how to monkey patch an API Skin.
I am unfamiliar with development in Flex but familiar with XML. Where is the GeocoderSkin.mxmls file so I can update the code?
Chris,
The GeocoderSkin.mxml is part of the Flex API download and is NOT included in the AGS Viewer for Flex source code. This is not as simple as modifying an xml file. So to begin with you will have to have a Flex IDE like Flash Builder. Do you have that?
I have an open source tool called FlashDevelop, but that's it. I can just open files, but built a basic Esri map using it before. Will that work?
I have an engagement to make it to, but will follow up as soon as I can in the morning.
Chris,
I can not provide any advice on using FlashDevelop. But you will have to recompile the ArcGIS Viewer for flex source code once you have monkey patched the GeocoderSkin.mxml in order to make the change to the maxChars for the Geocode component.
You said I can't just change the .mxml file. I'm not actually sure what a monkey patch is. What do I need to do?
Chris,
You can change the mxml file but then the whole AGS Viewer for Flex Source code will have to be recompiled with the change.
Robert Scheitlin, GISP can you follow me so I can send you a message?