cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Disable all buttons in a gallery when one is selected

I have a gallery with on each row a button. The button activates updates to the database (sharepoint lists).

When the user clicks a button somewhere (in a row) in the gallery all buttons must be set to 'disabled'. All buttons must be 'editable' again when the update is completed.

Currently the button that is selected will be disabled until the update is completed, however all other buttons are active during that proces. The database is updated incorrectly when the user hits another button during update of the previous selected button. That's why I want to set the buttons to 'disable' during the update.

Any ideas how to do that?

Thanks in advance

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Disable all buttons in a gallery when one is selected

Hi @RonHappel 

 

Ok, you mentioned this was in a gallery so that makes things easier:

 

On your button's OnSelect, you have it performing the update, so if you add this line before that:

 

Set(ThisButtonPressed, true);

 

and then the last line of the button's OnSelect (after your patching/update code) you should have:

Set(ThisButtonPressed, false);

 

Then for the DisplayMode of your Button, have it as:

 

If(
   ThisButtonPressed,
   DisplayMode.Disabled,

   DisplayMode.Edit

)

 

If you have any questions about this please feel free to ask 😺

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Resolver I
Resolver I

Re: Disable all buttons in a gallery when one is selected

Thanks,

 

I will try this tomorrow perhaps.

I'm not sure because it's Christmas.

 

Happy Holidays,

Ron.

 

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Disable all buttons in a gallery when one is selected

Hi @RonHappel 

 

Ok, you mentioned this was in a gallery so that makes things easier:

 

On your button's OnSelect, you have it performing the update, so if you add this line before that:

 

Set(ThisButtonPressed, true);

 

and then the last line of the button's OnSelect (after your patching/update code) you should have:

Set(ThisButtonPressed, false);

 

Then for the DisplayMode of your Button, have it as:

 

If(
   ThisButtonPressed,
   DisplayMode.Disabled,

   DisplayMode.Edit

)

 

If you have any questions about this please feel free to ask 😺

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Resolver I
Resolver I

Re: Disable all buttons in a gallery when one is selected

Thanks,

 

I will try this tomorrow perhaps.

I'm not sure because it's Christmas.

 

Happy Holidays,

Ron.

 

View solution in original post

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,179)