cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Saurabh-704
Helper III
Helper III

How to disable button when we are navigating from different screen

Actually the scenario is that I have to disable one button(Submit Button) which is in User screen , when it is navigating from Screen 1  and when it is navigating from screen 2 it should allow to edit that button (Submit button).

 

Note - The button (Submit Button) is in same screen only, that is User Screen.

So how can we give condition for this case?

2 ACCEPTED SOLUTIONS

Accepted Solutions

If you want another button to disabled while the another is enabled, then On the Back Button Put: If(!DisableButton,DisplayMode.Disabled,Edit) on the DisplayMode of the Back button. Note the !

With this when submit is enabled back is disabled and vice versa.

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @Saurabh-704

 

@eka24workaround is great, I just add one more thing.

If set the DisableButton Variable to false in Onhidden property of User screen, there is no need to configure the Screen2 Navigate button code.

This means that the button becomes disabled only when navigating from screen 1 to the user screen and becomes available again when the user screen disappears, which is sufficient for the current scenario and avoids configuring more navigation buttons if there are more screens to navigate to the user screen.

Hope this helps.

Sik

View solution in original post

5 REPLIES 5
eka24
Super User III
Super User III

Set two Variables in the Two screens Navigating Buttons:

1. On Screen 1 (Disable button) :  Set(DisableButton,true); Navigate(UserScreen)

Then On DisplayMode the SubmitButton: If(DisableButton,DisplayMode.Disabled,Edit)

 

2. On Screen 2 (Enable button) :  Set(DisableButton,false); Navigate(UserScreen) 

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Thank you @eka24 for the answer. Can we give two buttons inside that set button or what else can we do?. 

Suppose two button is their , with submit button ..one back button is also there. So if "submit button" is in editable mode, then "back" button should be disable and vice n versa.

So , How can we do this?

If you want another button to disabled while the another is enabled, then On the Back Button Put: If(!DisableButton,DisplayMode.Disabled,Edit) on the DisplayMode of the Back button. Note the !

With this when submit is enabled back is disabled and vice versa.

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @Saurabh-704

 

@eka24workaround is great, I just add one more thing.

If set the DisableButton Variable to false in Onhidden property of User screen, there is no need to configure the Screen2 Navigate button code.

This means that the button becomes disabled only when navigating from screen 1 to the user screen and becomes available again when the user screen disappears, which is sufficient for the current scenario and avoids configuring more navigation buttons if there are more screens to navigate to the user screen.

Hope this helps.

Sik

View solution in original post

Saurabh-704
Helper III
Helper III

Thank you so much for help. @eka24 and @v-siky-msft 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,305)