cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jvdlinden
Level 8

Dialog shortly showing when loading screen

Dear all,

 

I have a question in regards to my declaration app. I would like to address the following 'issue':

 

Imagine the follow scenario:

Purpose of the app = Submitting declarations.

 

This issue includes two screens:

  1. HomeScreen
    It shows a list of declarations already created.
  2. DetailsScreen
    It shows the details of the Gallery Item selected in screen 1. In this screen, the user is able to submit the declaration using a green colored button.
    I have added a dialog box to this screen no. 2 (DetailsScreen). It is just a 'Group' of two buttons, a rectangle, and a label. Purpose: to check if the user didn't hit the "Submit" button by accident.
    When the user pushes the button, it executes the following OnSelect function: UpdateContext({SubmitPressed:true}).
    And at last, the OnVisible property of screen2 is configured as: If(SelectedTripRecord.Status.Value="Submitted",UpdateContext({SubmitPressed:true}))
    As you can imagine, the Visible property of the grouped Dialog Box is set to: If(SubmitPressed=true,true,false).
    Super easy, right.

 

Now the issue. 

As you may understand, the dialog box should only display when the user hits the button "Submit". But what happens when I navigate from screen1 to screen2 by tapping the arrow button? Screen2 loads, and very shortly the dialog box displays and then disappears right after. The dialog box is not even shown for 1 second. But the behavior is not what I expected, not very professional.

 

I tried to figure out how to resolve this. I thought, this is easy: PowerApps is updating the value at screen2 OnVisible, that is too late! It should be done before. So, I altered the function on Screen1, so that it would pass the variable while navigating. It doesn't matter, PowerApps is still showing the Grouped controls for half a second.

 

That's about it. I hope my description is clear enough. I would like to know how I could eliminate this behaviour, the dialog box (grouped controls) shouldn't even show at all, no millisecond. 

 

Thanks in advance for helping out!

Joost

6 REPLIES 6
Super User
Super User

Re: Dialog shortly showing when loading screen

Have you tried adding an UpdateContext({SubmitPressed:False}) to the Navigation control on the Main screen that navigates to Screen 2?  like this:

 

Navigate(Screen2,ScreenTransition.Fade,{Submitted:true})

That would initialize Screen2 when it loads so that the dialog controls won't be visible. If its set to load to not visible as it loads I don't think it should flash on the screen during loading. I tried a simple test and it worked for me.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Re: Dialog shortly showing when loading screen

Sorry I missed looking at the screenshot before I responded.  I think you are on the right track. But I think you need to streamline your code and add the default record value earlier.  The other option you might try would be to use a Global Variable instead of UpdateContext and set that to not show the dialog before you even issue the Naviagate function in the Submit.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
jvdlinden
Level 8

Re: Dialog shortly showing when loading screen


@Pstork1 wrote:

Sorry I missed looking at the screenshot before I responded.  I think you are on the right track. But I think you need to streamline your code and add the default record value earlier.  The other option you might try would be to use a Global Variable instead of UpdateContext and set that to not show the dialog before you even issue the Naviagate function in the Submit.


Hi @Pstork1, I have tried using a global variable:

2019-06-27 10_02_27-Window.png

 

And only when pressing the Submit button, this function will change the global variable: Set(SubmittedPressed,true)

 

There is one more thing I would like to add. The dialog is only showing shortly once. When I navigate back, and open another declaration, the behaviour is not occurring... Maybe this info could be of help?

 

Super User
Super User

Re: Dialog shortly showing when loading screen

I was suggesting you set the Global Variable to false on Screen 1 before you navigate to screen 2.  Unlike Context variables that are only available in a specific screen or when navigating to a specific screen the global variable is available all the time.  The reason it doesn't flash on the screen the second time you navigatte to Screen 2 is because the variable has already been set the first time you navigated to and from screen 2. So the second time around it doesn't have to change the default during the navigation.  The timing of that change is what I think causes the flash.  So presetting a Global variable to prevent the display while you are still on Screen 1 should make the first load run the same as subsequent loads.  At least that would be the theory.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
jvdlinden
Level 8

Re: Dialog shortly showing when loading screen

Hi @Pstork1

I tried it right away, but even setting the global variable on Screen1 doesn't help.

It keeps flashing.

Super User
Super User

Re: Dialog shortly showing when loading screen

Not sure what else to suggest.  I am unable to replicate your issue.  I assume that's due to the complexity of your application vs my simple markup.  I wish I could be more help.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 45 members 4,125 guests
Please welcome our newest community members: