Select to view content in your preferred language

Editor Widget- Size of attribute textbox

3219
9
09-12-2011 12:51 PM
DavidFlack
Regular Contributor
I'm working on an application with a slightly customized editing widget.  Everything works, except that one of my text boxes is much larger than the others.  Ones for relatively small fields work great, but the one I have for a 100 character field (Facility Name in the attachment) is taking up more than twice as much room as it should.  It does only let me enter 100 characters.  I don't get it...

I've scoured the code and not been able to find anything that lets me control this.  Is there a setting somewhere I can use to change this?  It's not the end of the world, but it just doesn't look really professional.

Any help would be appreciated.
Dave
Tags (2)
0 Kudos
9 Replies
BjornSvensson
Esri Regular Contributor
... customized editing widget ... one of my text boxes is much larger than the others.  Ones for relatively small fields work great, but the one I have for a 100 character field (Facility Name in the attachment) is taking up more than twice as much room as it should.


The code you are looking for is the singleToMultilineThreshold property of the AttributeInspector.  If the field has a length of 40 characters or less, it will be shown as a single line, otherwise it's shown with multiple lines.  The "40" can be changed with the singleToMultilineThreshold property.
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/components/AttributeInspector.html#singleT...
0 Kudos
DavidFlack
Regular Contributor
Thanks Bjorn for your fast reply.  Unfortunately, I just can't seem to find any more information or examples on exactly where and how to set this property.  Is there anything you else you could point me to?

Dave
0 Kudos
DavidFlack
Regular Contributor
Never mind- just figured it out.  In the case of the edit widget, go to the basewidget_creationCompleteHandler function and add your desired threshold:

     editor.attributeInspector.singleToMultilineThreshold = 75;
0 Kudos
DavidFlack
Regular Contributor
Bjorn,

Now that I understand how this works, I can't say I'm a big fan of it.  A single line will do in this case as most of the input in this field will be much smaller than 100 characters.  But it seems that the multiline input is always the same size.  It would be nice in the future if the text box could come closer to matching the size of the field it's bound to.

Then again, maybe this is already resolved.  I'm still using version 2.2 of the API.

Dave
0 Kudos
RachelS
Frequent Contributor
Hi,
I'm trying to make these changes using ArcGIS Viewer for flex version 3. I can't see the singleToMultilineThreshold property either in the config file or the edit widget .xml file.
Can anyone point me the right direction to make the necessary changes for version 3 as the boxes for my attributes are coming up very large also.  I am only using the compiled version are these changes only possible with API flexbuilder?

Many thanks

Rachel
0 Kudos
RachelS
Frequent Contributor
Hi,
I'm hoping someone will get back to me about my post above.
If only using the compiled version is there any way to make the text boxes smaller on the Editor attribute box?

Many thanks

Rachel
0 Kudos
SarthakDatt
Frequent Contributor
Rachel,

Unfortunately, right now the only way to make that possible is to update Edit widget's source code. Not possible in the compiled viewer.
0 Kudos
RachelS
Frequent Contributor
Ah right, that a pity. Hopefully it will be an option in the next release.
Thanks for your response Sarthak.
Rachel
0 Kudos
MehulChoksey
Esri Contributor
Thanks for the feedback. Submitted enhancement request
0 Kudos