How to reset GeodatabaseFeatureServiceTable

1190
3
09-23-2016 02:17 PM
AnkitPrahnani1
New Contributor III

I want to use the same featuretable object for  different feature layers in my app.

The user can choose either of the feature layers with the press of the button.

Now when the button is pressed for the first time the things work fine. But if the user goes back to the home page and presses the other button and proceeds then the issue is that the fields of both the feature layers are visible instead of just the one feature layer selected.

I think this issue is because the information of the previous feature layer is still there in the geodatabasefeatureservicetable.

So how can i reset this when the button is pressed.

#quick report

#featuretable

0 Kudos
3 Replies
LucasDanzinger
Esri Frequent Contributor

Ankit-

The feature table should only be used by one layer. In your workflow, could you dynamically create the feature table each time you navigate to that page, so that it doesn't have any reference to the old layer? You could use ArcGISRuntime.createObject("GeodatabaseFeatureTable") for this.

AnkitPrahnani1
New Contributor III

Hey Lucas,

Thank you for your reply.

I have been trying to work on your suggestion but I am not succeeding.

Background: I am trying to modify the quick report app by adding extra buttons for the user to choose the feature service in which he wants to fill-up the information.

Now, the GeodatabaseFeatureTable in the quick report template is very complicated and I am not able to replicate it and dynamically create it again. It has been referenced in several other pages of the app.

So I think I have may have only 2 options:

1. First is to find a way to reset the  GeodatabaseFeatureTable when the button for the second feature calss is pressed.

OR

2. To find a way to reset the entire quickreport page OR the App{} component when the button for the feature class is pressed.

If resetting the  GeodatabaseFeatureTable is not possible then can you tell me if there is a way to reset the app{} on button press?

Thanks a lot for your help!

0 Kudos
LucasDanzinger
Esri Frequent Contributor

You won't be able to reset the geodatabasefeaturetable. Once it is initialized, that's it. You could move all your code into a new QML file (not have it be in the main App{}), and then use a QML Loader component to load it again and again. Loader QML Type | Qt Quick 5.7