Select to view content in your preferred language

async methods in addin

690
2
01-05-2023 07:50 AM
Mannus_Etten
Occasional Contributor

i see a lot of examples with queuedtask.run which is according to the documentation to let sync-methods of the SDK run in the background.

I made an custom gallery and want to populate data from Portal on the dropdownopened.

Then I run into statements like:

var results = await ArcGISPortalExtensions.SearchForContentAsync(portal, query);

How do I use those than properly inside the public async void DropdownOpened?

After the results are loaded I wanted to change some state-properties as well.

How will I be sure that the results are fully loaded first before the state change?

I tried many options already and I am not sure about any of them. In some cases nothing happens but the spinner is still visible and keeps on going.

 

CEO the Right Direction BV/Portal Genius
0 Kudos
2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor
Mannus_Etten
Occasional Contributor

thanks, yeah looks good but still I do have some questions.

Mannus_Etten_0-1674138318786.png

the button with the arrow can show a list of items. But the list is empty and the busy indicator will never go away... How can i hide the busy indicator and show for example a text 'no items available' ?

 

The second thing is the thumbnails. I marked in yellow the text 'meetvakken'. That is visible over the thumbnail.

If you open the gallery you see that meetvakken is an item without a thumbnail...

Mannus_Etten_1-1674138434572.png

 

how can i prevent that the title is placed over the thumbnails?

CEO the Right Direction BV/Portal Genius
0 Kudos