Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Question to Listview and ItemSelected

$
0
0

Hi all

I have an app that queries an webservice (json) and shows the data.

First the data are showed on a (main-)page with a listview.
If the user the select a entry on the listview, the detail-data to that entry are queried from webservice and a detail-page is called.

The query of the detail-data and the call of the detailpage are called from a .ItemSelected- handler to the listview (code-snipped see below).

Problem:

  • Anything works fine by first selection of an entry (first-time fire .ItemSelected-event).

  • If the user click a entry, the detail-data are queried and the data are showed on the detail-page

  • If the user then clicks the back-button he comes back to the (main-)page

** - If the user then clicks the same entry once again, nothing happens**

  • If the user then clicks another entry anything works

  • After the user has clicked another entry, the user also can click the same (first) entry and anything works

Question:

  • Is this the "normal" behavior (it seems, as the behavior is the same on iOS / Android and WP) or do I something wrong in my code (see below)?

Thanks for any answer.

Code-snipped to ItemSelected-handler:

lvErgebnisAnzeige.ItemSelected  += async (sender, e) =>
{
  var eq = (Empfehlung)e.SelectedItem; 
  switch (GV.iGuideWahl)
  {
    case 0: // FreitzeitGuide
     // Generate URL…
       var sv = new MG_WS_FreizeitDetails();
       indicator.IsRunning = true; // Indicator aktivieren
       indicator.IsVisible = true;
       var FZ_Details = await sv.GetFreizeitDetails(cURL); // Query WebService
       indicator.IsRunning = false; // Indicator deaktivieren
       indicator.IsVisible = false;
       if (FZ_Details == null) 
       {
         await this.DisplayAlert("Fehler bei Abfrage der Daten", "Bitte Internetverbindung prüfen und dann nochmals versuchen", "OK");
         return;
        }
        FreizeitDetails fz_objekt = FZ_Details[0];
        await this.Navigation.PushAsync(new FreizeitDetailsServerPage(eq, fz_objekt)); 
        break;
     case 1: // Gourmetguide
        await DisplayAlert("Hinweis", + "Not yet implemented ", "OK");
        break;
      case 2: // BeautyGuide
        await DisplayAlert("Hinweis", + "Not yet implemented ", "OK");
        break;
       default:
         await DisplayAlert("Fehler", "default wurde ausgelöst (darf nicht passieren!)", "OK");
       break;
}

Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>