We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Popup closes immediatly when opened in OnAppearing

Thread ID:

Created:

Updated:

Platform:

Replies:

147029 Aug 29,2019 09:47 AM UTC May 8,2020 12:46 PM UTC Xamarin.Forms 5
loading
Tags: SfPopup
Martin
Asked On August 29, 2019 09:47 AM UTC

Hi

I've created a method to show a modal message box with SfPopupLayout in code. This Popup is opened sometimes after popping a page from the navigationstack. I handle this in the OnAppearing method of the now top page of the navigationstack. Unfortunatly, the popup is shown for just a fraction of a second and then removed.

I haven't found any later event to handle this. Does anyone have an idea how to keep that popup open or where the appropriate position for the call would be?

The code I'm using for the popup:

public void ShowMessageBox(
      string sMessage,
      string sOkText,
      Command okCommand = null,
      string sCancelText = null,
      Command cancelCommand = null)
    {
      var msgBox = new SfPopupLayout();

      msgBox.PopupView.AcceptButtonText = sOkText;
      if(!String.IsNullOrEmpty(sCancelText))
      {
        msgBox.PopupView.AppearanceMode = AppearanceMode.TwoButton;
        msgBox.PopupView.DeclineButtonText = sCancelText;
      }

      if (okCommand != null)
        msgBox.PopupView.AcceptCommand = okCommand;

      if (cancelCommand != null)
        msgBox.PopupView.DeclineCommand = cancelCommand;

      msgBox.PopupView.PopupStyle.CornerRadius = 10;
      msgBox.PopupView.ShowHeader = false;
      msgBox.PopupView.ShowCloseButton = false;
      msgBox.PopupView.AutoSizeMode = AutoSizeMode.Height;

      var contentTemplateView = new DataTemplate(() =>
       {
         var lbl = new Label();
         lbl.Margin = new Thickness(5, 10);
         lbl.Text = sMessage;
         lbl.LineBreakMode = LineBreakMode.WordWrap;
         lbl.WidthRequest = 260;

         var stack = new StackLayout();
         stack.Children.Add(lbl);
         return stack;
       });

      msgBox.PopupView.ContentTemplate = contentTemplateView;

      /// Makes the Message modal
      msgBox.StaysOpen = true;
      msgBox.IsOpen = true;
      msgBox.Show(false);
    }


Balasubramani Sundaram [Syncfusion]
Replied On August 30, 2019 08:00 PM UTC

Hi Martin,  
 
Thank you for contacting Syncfusion support.     

 
Based on your code snippet we have checked the issue “Popup closes immediately when opened in On Appearing”. We have checked the issue in UWP platform we didn’t get any issue its working fine in our side but when we have checked in android platform, we faced a same issue when we forth back to pervious page within the Navigation Page. We have prepared a sample based on your provided details please confirm whether you are trying to convey the same this will be more help us to provide a solution at earliest. 
 
Please refer the following sample, 
 
 
Regards,
Balasubramani Sundaram. 


Martin
Replied On September 3, 2019 08:31 AM UTC

Hello,

while in my case I've routed everything into the ViewModel and I actively pop the second page, the behaviour in your sample project when coming back to the first page is exactly the same as what I am experiencing. I found a workaround by starting a thread that delays for 500 ms before opening the popup, but not needing this rather hacky solution would be nice.

greets
Martin

Balasubramani Sundaram [Syncfusion]
Replied On September 4, 2019 11:59 AM UTC

Hi Martin,  
 
Thank you for the update.  
 
We have already fixed the issue “Popup closes immediately when opened in On Appearing” and the issue fix will be included in our upcoming 2019 Volume 3 Beta release which is expected to be roll out by mid of September 2019. Please let us know if you required a patch earlier.   
    
We appreciate your patience until then.   
  
Regards,  
Balasubramani Sundaram. 


Luke McNally
Replied On May 7, 2020 07:56 AM UTC

Please can you confirm the bug ID and what build the fix actually went into? We're running 17.4.0.53 and are still experiencing the issue on Android. I've reviewed the release notes for 2020 Volume 1 and can't see any mention of it being fixed in there.

Karthikraja Kalaimani [Syncfusion]
Replied On May 8, 2020 12:46 PM UTC

Hi Luke,

We have logged that bug as internally and included the fix in the version 17.3.0.26. So only the we did not mention the bug in release update. Moreover, we have checked the reported issue in SfPopupLayout version 17.4.0.53 and we could not able to reproduce the issue in our end and it is working fine as expected. Since we are not about your exact application scenario. So could you please reproduce the issue in the below attached sample and revert us back with clear replication procedure.

Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Popup_Demo96799049-1530933884.zip

Regards,
Karthik Raja 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon