Cannot make edits on a QML PopupView after calling startEditing() on the C++ PopupManager

1815
11
Jump to solution
12-29-2017 09:57 AM
JeffreyKing
New Contributor II

I am using a popup view to make edits on an AGO feature service. I am successfully identifying and filling the PopupView with the feature's popup data. Whenever I call the startEditing() function from the PopupManager, though, nothing happens. The returned value from the function call is "true", which means that it was successful and should be allowing editing through the PopupView, but I cannot interact with the fields and data to actually make any changes, it acts like a static, non-interactive, window that just shows field data.

1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Hi Jeffrey,

While the PopupManager fully supports editing, the PopupView that is in the toolkit currently only supports viewing the attributes at this time. If you need Popup editing now, you can consider changing the source of the toolkit control to do what you need. You can see here that the attribute value is displayed as formatted text in a QML Text element - https://github.com/Esri/arcgis-runtime-toolkit-qt/blob/master/Import/Esri/ArcGISRuntime/Toolkit/Cont... 

The idea is that the PopupManager is the brains behind the PopupView, so you can use the information from the manager to update the view accordingly. A few things you will for sure need to do to get going:

- change the model of the repeater in the PopupViewBase.qml from PopupManager::displayedFields to PopupManager::editableFields

- use the various roles in the PopupAttributeListModel to know what to display (TextBox for string input, ComboBox for domains, Calendar for Date picker, etc) PopupAttributeListModel Class | ArcGIS for Developers 

View solution in original post

11 Replies
LucasDanzinger
Esri Frequent Contributor

Hi Jeffrey,

While the PopupManager fully supports editing, the PopupView that is in the toolkit currently only supports viewing the attributes at this time. If you need Popup editing now, you can consider changing the source of the toolkit control to do what you need. You can see here that the attribute value is displayed as formatted text in a QML Text element - https://github.com/Esri/arcgis-runtime-toolkit-qt/blob/master/Import/Esri/ArcGISRuntime/Toolkit/Cont... 

The idea is that the PopupManager is the brains behind the PopupView, so you can use the information from the manager to update the view accordingly. A few things you will for sure need to do to get going:

- change the model of the repeater in the PopupViewBase.qml from PopupManager::displayedFields to PopupManager::editableFields

- use the various roles in the PopupAttributeListModel to know what to display (TextBox for string input, ComboBox for domains, Calendar for Date picker, etc) PopupAttributeListModel Class | ArcGIS for Developers 

JeffreyKing
New Contributor II

Thanks Lucas. Any idea if the PopupView will get official editing support anytime soon?

0 Kudos
LucasDanzinger
Esri Frequent Contributor

I don't know on dates, but hopefully soon. If you can message me some details about your organization, project, etc, I can add these details into our backlog item to hopefully give it more urgency.

0 Kudos
JeffreyKing
New Contributor II

It won't let me direct message you, but I applied the fix you suggested, with some of my own additions and got it working. I am doing this in order to make edits on an offline map and sync the edits in real time with the online feature service. 

0 Kudos
PamTurner1
New Contributor

Hi Jeffrey,

Any chance you could share how you got the editor working? Seems like it would be useful to quite a few folks who are struggling with the same limitation to the popup view.


Thanks!

0 Kudos
PamTurner1
New Contributor

Was this ever implemented? The documentation states that the PopupView can be used for editing, but "Start Editing" still has the same behavior.  A static box that does not allow any interaction.


Thanks.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Hi Pam,

Unfortunately, the View itself does not yet support Editing. The PopupManager does support editing and should help in any view implementation, as it does some things like keep track of state, provide editable list models for attributes, etc. Editing support in the View is still in the road map, we just don't have a date for it yet.

0 Kudos
PamTurner1
New Contributor

Thank you for the quick answer. Are there any examples of using the Popup Manager to aid in this process. Even after much research and searching, the only sample I've found seems to bypass the Popup Manager.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Unfortunately we don't have any samples, as many of the editing samples were created before we had the PopupManager/View. I hope we can get to this soon!

0 Kudos