Feature attributes have specific data types which the QT SDK v100.0 enumerates here: https://developers.arcgis.com/qt/latest/qml/api-reference/enums-fieldtype.html
How would you recommend verifying that a user-inputted string will be supported in the feature table? If a datum is formatted incorrectly, the feature table rejects my updates instantly without sending a request. To me this indicates there are definitions for these field types somewhere in the library. How do I access this so I can make sure to validate/convert user input correctly?
The Field has a FieldType enumeration, which are things like Date, String, Int, etc. String should accept anything that is a QString, Date should accept anything that is a QDate, and so on. Eventually, we will have a fully functional Popup that will help streamline these editing workflows. We have the building pieces in all of the Popup* classes, but we do not yet have an associated view to go with it.
The feature table has a list of fields, which contains names and field types. You could validate against that to make sure you are using the correct data type - FeatureTable Class | ArcGISQtCpp 100.0
Also, if your services make use of FeatureTemplates or FeatureTypes, you could use the createFeature functions that create a new feature based on the feature type or template.
I don't see how to validate an attribute value from the fields in the feature table class. Say for example I want to allow users to input text to change an attribute value for an "esriFieldTypeDate" field, when I input "test" in that field, it fails to update saying the string is an invalid format. Are correct formats for constructing "esriFieldTypeDate" from a string listed somewhere?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.