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

Disabled Gallery Item still selects

I have a gallery with two controls the Display Mode is acertained by a simple evaluation of a formula, there are three items in the gallery two are enabled (edit mode) and one is disabled.

Clicking these toggle visibility of Forms on the screen, one of the forms has a dropdown which gets its selected value from the current selected gallery item, so when I selected disabled item I expect the dropdown to remain the same, however it changes it's value to the disabled item.

So question is does clicking a disabled item changed the selected gallery selected item, and if so should this not be the case

1 ACCEPTED SOLUTION

Accepted Solutions
AndrewCarter
Level 8

Re: Disabled Gallery Item still selects

@yashag2255,

 

Many thanks for the reply; I only raised the query as a general question as it seems counter productive to have a Gallery selection made by selecting a disabled control.

I think I used a ContextVariable in the end to achieve what I wanted this also enabled me to exclude the disabled items.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Disabled Gallery Item still selects

Hi,

 

I tried to recreate this but was unable to - Are you sure there's no other object within your gallery (like the gallery card itself) that is enacting Select(Parent) ? Anything within that Card that uses Select(Parent) will then affect which item is selected.

 

Could you creat an App to share with us (no business data, just standalone a simple .msapp) that is able to replicate this issue?

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
AndrewCarter
Level 8

Re: Disabled Gallery Item still selects

@iAm_ManCat,

 

I just created same super simple test app (see attached) and I am still seeing the same issue.. I managed to get around my original problem, but just curious.

 

Andrew

Dual Super User
Dual Super User

Re: Disabled Gallery Item still selects

Hi @AndrewCarter 

 

I carried out some test on the app shares by you, and you can modify few properties as:
 
Button: OnSelect: If(ThisItem.Enabled = true,Set(SelectedEnabled,ThisItem))
 
Text Label: "Tab selected:" & SelectedEnabled.Label
 
This way the SelectedEnabled variable will only be changed when an enabled item is selected from the gallery. If a disabled item is selected this won't change the results.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
AndrewCarter
Level 8

Re: Disabled Gallery Item still selects

@yashag2255,

 

Many thanks for the reply; I only raised the query as a general question as it seems counter productive to have a Gallery selection made by selecting a disabled control.

I think I used a ContextVariable in the end to achieve what I wanted this also enabled me to exclude the disabled items.

View solution in original post

Highlighted
Super User
Super User

Re: Disabled Gallery Item still selects

Ok, had another dig - I can now answer why it is doing this - I ahve attached a modified version of your App

Answer (it's the understanding and implementation):

 

In your first gallery, you are having the label below it look at Gallery.Selected.Label, but Gallery.Selected is the Selected Gallery Item, not the rectangle that you have disabled!

 

In my second gallery, I have set the OnSelect of that Gallery Item to Set(SelectedItem, ThisItem.Label), and the label below it to "Tab selected:" & SelectedItem

 

We can see that this is now working as expected, with the disabled block not setting any value, the gallery item is still being selected but the button is performing no action 🙂

 




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (6,108)