cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MateusPereira
Level: Powered On

Making buttons disappear

So I have this gallery with a lot of items, and each item has 2 buttons that change visibility depending on the other one. How can I make it so that when I click on one of them (doesn't matter which) I make all buttons of all the gallery items disappear too while the app loads so people when using the app don't spam the buttons while it is loading?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Making buttons disappear

@MateusPereira 

Are you unable to use UpdateContext in the OnStart of you app as your gallery controls are on a different screen?

If this is the case then use Set(GalleryButtonsVisible, true) to define the variable in a global scope. You should then be able to access it from anywhere in your app. You would also need to use the Set(GalleryButtonsVisible, false) function when clicking the buttons in the gallery.

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


3 REPLIES 3
Highlighted
Super User
Super User

Re: Making buttons disappear

Hi @MateusPereira 

You can create a property that you can update in the OnSelect of the gallery buttons. Add the following function to the button's OnSelect.

UpdateContext({GalleryButtonsVisible:false})

Then add a check (in addition to your existing visibility conditions) of the GalleryButtonsVisible variable to the button's Visible property.

Once your loading is completed, simply update the variable again to true using UpdateContext({GalleryButtonsVisible:true})

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


MateusPereira
Level: Powered On

Re: Making buttons disappear

@LeeHarris 
But when I initially load the app the variable isn't neither true or false and I can't use: UpdateContext({GalleryButtonsVisible:true}) on the OnStart funtion of the app, so how do I resolve this problem?

Super User
Super User

Re: Making buttons disappear

@MateusPereira 

Are you unable to use UpdateContext in the OnStart of you app as your gallery controls are on a different screen?

If this is the case then use Set(GalleryButtonsVisible, true) to define the variable in a global scope. You should then be able to access it from anywhere in your app. You would also need to use the Set(GalleryButtonsVisible, false) function when clicking the buttons in the gallery.

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


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: 51 members 3,852 guests
Please welcome our newest community members: