Select to view content in your preferred language

Editing

2621
6
02-01-2011 03:59 AM
CaseyBentz
Frequent Contributor
I am attempting to implement an editing solution for a stand alone table.  I basically have it all figured out but, would like to run through a list of questions/frustrations in hope that someone has solved them.

I am using an attribute inspector with a list of field inspectors.  I have been unable to make the attribute inspector height property big enough.  Basically, it looks like there is a max height that I am unable to get past.  I have a couple comments type fields and the get a big text area box which takes up a ton of space and that gives me a vertical slider which makes me really annoyed.  I have tried to set the height of every parent container and still get the same max height.

The renderers are annoying to say the least.  I have a bunch of comboboxes that are populated with domain values.  This is great, however the combobox has the first value from the domain as the default value, can I not set a prompt?  This is causing confusion for my users.  Say I have a combobox that defaults to 'Class A' and the user wants 'Class A' as the value.  They assume they don't have to do anything because the value already says 'Class A'.  Well, the value only gets saved if the user opens and closes the combobox. 

Also, I would like to change the width of the combobox.  I can't figure out how this is possible.

Any ideas would be greatly appreciated.
Tags (2)
0 Kudos
6 Replies
AniketWani
Esri Contributor

  I have a couple comments type fields and the get a big text area box which takes up a ton of space and that gives me a vertical slider which makes me really annoyed.


Try setting the singleToMultilineThreshold property on Attribute Inspector. Say your field in feature service is of length 50 characters, set singleToMultilineThreshold to 51 to get single line text input.
Read more : http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/components/AttributeInspector.html#singleT...


Say I have a combobox that defaults to 'Class A' and the user wants 'Class A' as the value.  They assume they don't have to do anything because the value already says 'Class A'.  Well, the value only gets saved if the user opens and closes the combobox. 


Thanks for reporting this bug. It will get fixed in next release.

I hope this helps.
0 Kudos
CaseyBentz
Frequent Contributor
I decided, with the help of your information, to create my own editor UI and not use the Attribute Inspector. I have it all working except for a date field. I am using a DateField component and attempting to send the text property to the graphic. I am using the featureLayer.applyEdits([graphic], null, null... command. When I do this, I get an error message - Invalid graphic features\nInvalid parameters. So I investigated what the Attribute Inspector was sending when I changed the date. When I set the date as 2/3/2011, it actually sends 1,296,716,400,000. When I set the date as 2/2/2011, it actually sends 1,296,663,000,000. The difference is 86,400,000. Which is the number of thousandths of seconds in one day.

So, if I take 1,296,716,400,000 and divide it by 1,000, I get 1,296,716,400 which is the number of seconds from the start date. I then divide that by 60 and get 21,611,940 which is the number of minutes since the start date. I then divide that by 60 and get 360,199 which is the number of hours since the start date. If I divide that by 24 I get 15,008.2916 which is the number of days since the start date. If I divide that by 365 I get 41.1186 which is the number of years since the start date. Which is 1970ish. So, I entered 1/1/1970 in as my date and it sends
25,200,000 and I enter 12/31/1969 and it sends -61200000. So, it looks like sometime between 12/31/1969 and 1/1/1970 is 0.

So does anyone know what I am talking about here? Because I feel like I am lost in a sea of numbers. I am assuming there is a method on the DateField that will give me this value, or maybe I am just crazy and need to just use a to_date function or something. We are using a 9.3.1 Oracle 10g database with ArcGIS Server 10 sp1.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Casey,

    ArcGIS Server is storing date field values as milliseconds UTC. The flex date component handles all the conversion you are needing.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html
0 Kudos
DasaPaddock
Esri Regular Contributor
The value of the date fields attribute should either be a Flash Date instance or the date's time property.
0 Kudos
CaseyBentz
Frequent Contributor
Robert and Dasa,

Thanks for the help. 

Instead of DateField.text, I used DateField.selectedDate.time.toString()
0 Kudos
mei09
by
Deactivated User
HI Casey

i would like to implement something like you mentioned, ie, an attribute only editing functionality in the ArcGIS Viewer for Flex for both map features and stand-alone tables, where the user can do a selection of many features on the map and the attributes of all the selected features would populate a more appropriate GUI (like a datagrid).

Looking at the samples (the attribute inspector outside of the map sample), I'm not sure how this can be implemented. Would you be able to share the steps on how you achieved your customized editing template (instead of using the AttributeInspector)?

Also, is there a way in which we can stop the auto-posting of changed attribute values in the Attribute Inspector?

Any advice would be appreciated.
thanks
0 Kudos