SfPopupLayout/SfBusyIndicator not showing in Master(menu)-Detail Page

In the attached sample, from the MainPage, you can navigate to the Master(menu)-Detail pages PageA and PageB. OnNavigated, the expectation is for the PopupLayout/BusyIndicator to work, but they do not.

If the navigation mechanism is changed from Master(menu)-Detail, to direct navigation, the BusyIndicator works.

Please help with getting the BusyIndicator to work in Master(menu)-Detail.

//navigating with these cause the popup layout to not show
public Command NavPageA => new Command(async () => await NavigationService.NavigateAsync("/MenuPage/NavigationPage/PageA"));
public Command NavPageB => new Command(async () => await NavigationService.NavigateAsync("/MenuPage/NavigationPage/PageB"));
 
 
//navigating with these will show the popup layout/busy indicator
//for this to work, need to comment the ToggleMenuCommand in each page.
 
//public Command NavPageA => new Command(async () => await NavigationService.NavigateAsync("PageA"));
//public Command NavPageB => new Command(async () => await NavigationService.NavigateAsync("PageB"));

Attachment: BusyIndicatorTests__after_fix_Bug_v2_fc2b3e2e.zip

10 Replies

SP Sakthivel Palaniyappan Syncfusion Team February 20, 2020 01:44 PM UTC

Hi Reza,

Thanks for your update.

Currently we are validating the reported issue, we will update the details on 24th February 2020.

Regards,
Sakthivel P. 



SS Sivaraman Sivagurunathan Syncfusion Team February 24, 2020 01:59 PM UTC

Hi Reza, 
 
Sorry for the inconvenience. 
 
Currently we are validating the reported issue, we will update the details on 26th  February 2020. 
 
Regards, 
Sivaraman 



SS Sivaraman Sivagurunathan Syncfusion Team February 26, 2020 04:06 PM UTC

Hi Reza,  
  
Sorry for the inconvenience.  
  
We are still validating the reported issue in our source level. Due to complexity, we unable to find the exact root cause for the issue and we will update the details on 27th February 2020 without any further delay. 
  
Regards,  
Sivaraman  



SS Sivaraman Sivagurunathan Syncfusion Team February 27, 2020 02:21 PM UTC

Hi Reza, 

Thanks for your patience. 

We have validated the reported issue from our side. When we use the Master(menu)-Detail mechanism for navigation, we have shown the popup by setting the ShowBusy as true. At the same time Master Detail page navigation process run asynchronously and at that time the parent element will be set to null and set the new page as parent for SfPopupLayout from prism. Usually have close the popup, when the popup layout parent is null. So that the popup is closed. So you can use the direct navigation to overcome the issue. 


Regards, 
Sivaraman S 



RE Reza February 27, 2020 02:53 PM UTC

I cant understand anything you said above, it makes no sense. Can you modify my project and show how you solved the issue please? 


KK Karthikraja Kalaimani Syncfusion Team February 28, 2020 01:41 PM UTC

Hi Reza,

Since we have listened the main page property to close the PopupView whenever the page gets navigated to another page and this is the behavior of SfPopuplayout but in your cases the prism sets the PageA parent to null and at a same time the popup is trying to open while navigating from master detail page to Page A. So, tends to close the popupview. To overcome this issue please use direct navigation to PageA instead of MasterDetail page. For more details please refer the below code example.


 

public Command NavPageA => new Command(async () => await NavigationService.NavigateAsync("PageA")); 
public Command NavPageB => new Command(async () => await NavigationService.NavigateAsync("PageB")); 
 
 

Regards,
Karthik Raja 



RE Reza February 28, 2020 02:55 PM UTC

This is a use case for me to use the Prism DialogService. You can't just recommend a full-page navigation when I need the user to stay on the same page and the use case requires displaying a modal.

The workaround for this issue was to just add a delay of 100ms before displaying the DialogService modal and it works fine, so there is a bug on the SF side.

The SF response to this is not an answer, there is a bug with the popuplayout on the SF side.


SS Sivaraman Sivagurunathan Syncfusion Team March 2, 2020 04:49 PM UTC

Hi Reza,  

By default, popup is closed when on navigating to another page and this is the behavior of the SfPopupLayout. But in your cases, we used the Master(menu)-Detail mechanism for navigation, at the time the prism sets the MenuPage  to PageA as parent for SfPopuLayout, and we have set the ShowBusy as true to show the popup view which runs asynchronously. Due to this Parent property changes is  triggered in SfPopupLayout and tends to close the popupview. If you provide some delay before set the ShowBusy as true while navigating, the navigation process in done in prism, after that only the popup is open, So popup is in view without any issue. So you need to provide some  delay before setting the ShowBusy as true or use direct navigation to navigate.  
  
Regards,  
Sivaraman S 



RE Reza March 3, 2020 05:13 AM UTC

As I had mentioned in the previous reply, I had found the workaround to add a delay. However, this feels like a hack more than anything. This should be reported as a bug and reviewed.


MK Muthu Kumaran Gnanavinayagam Syncfusion Team March 4, 2020 01:33 PM UTC

Hi Reza, 
 
We have analyzed all the possibilities to overcome this issue. When the Parent element of the SfPopupLayout gets changed and if the Popup is currently showing, it will be closed and its corresponding elements will be disposed. This is done at our end to avoid memory leaks while navigating across pages. This is the actual behavior of SfPopupLayout control in navigation. In your application, you have the SfPopupLayout instance in both PageA and PageB. While navigating from the PageA with Popup in open state, the Parent element of the Popup instance in PageA gets changed[which is done by Prism]. This results in closing and disposing of Popup instance in PageA. 
 
The time delay which is used as an workaround while navigating results in creating new instance for SfPopupLayout in PageB after disposing the SfPopupLayout instance in PageA. Thus specifying delay helps to achieve your requirement. The main idea of processing the navigation is by asynchronous process. So you can run the process in a different thread as like below to overcome the reported behavior. 
 
Solution 1: 
 
Code Example: 
 public override async void OnNavigatedTo(INavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);
 
  
            Device.BeginInvokeOnMainThread(() =>
            {
                ShowBusy = true;
            });
 
  
            await Task.Delay(5000);
            Device.BeginInvokeOnMainThread(() =>
            {
                ShowBusy = false;
            });

        }
 
 
 
Else you can provide time delay as we have mentioned in our previous updates. 
 
Solution 2: 
 public override async void OnNavigatedTo(INavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);
 
           await Task.Delay(10);
           ShowBusy = true;
 
           await Task.Delay(5000);
           ShowBusy = false;
        }
 
 
So in your application, if your requirement is to display a modal you need to run the navigation process asynchronously and allow creation of new SfPopupLayout instance in navigated page. 
 
Regards, 
G.Muthu kumaran. 


Loader.
Up arrow icon