cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
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

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

Helper III
Helper III

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

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (89,811)