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

The opposite of the OnSelect() method

Hi,

 

My issue is I want to disable a button if the user has entered a text field and then re-enable it once the focus is changed.  In the OnSelect() method I can set the Mode of the button but there is the lack of the opposite of the OnSelect() method to reneable the button.  

 

I tried putting the code in the OnChange() method.  The start of the OnChange() method disables the button and the very last bit of code re-enables the button.  However if the user is in the text field and changes some value, and then clicks the button without clicking anywhere else on the app, the onChange() method is not being executed before the button code which I need it to do.  

 

How can I achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: The opposite of the OnSelect() method

@samuelJ 

There was only 1 idea I could find and unfortunately it has only 1 vote.  However, your vote will double that and I can upvote it for you too.  https://powerusers.microsoft.com/t5/PowerApps-Ideas/OnFocus-Property/idi-p/247636

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

5 REPLIES 5
Super User
Super User

Re: The opposite of the OnSelect() method

@samuelJ 

I would suggest using this code in the DisplayMode property of your button

 

If(IsBlank(TextInput.Text), Disabled, Edit);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

samuelJ
Level 8

Re: The opposite of the OnSelect() method

Hi @mdevaney , 

Thanks for your reply.  The code I have in the onselect is much more than just checking if a text box is blank or not. 

 

There are X number of text boxes.  The user can have them blank or filled in.  What is really important is if the user changed the value of what is in the textbox(s).

 

Something that would really save my day is having functionality around when focus is gained and focus is lost for a text box.  (onSelct & onDeSelct or something).

Super User
Super User

Re: The opposite of the OnSelect() method

@samuelJ 

Sorry, there is not any ability in PowerApps to detect what control is focused on.  I suggest you create a new Idea for it. https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

samuelJ
Level 8

Re: The opposite of the OnSelect() method

Ok, well thank you for your time!  I will probably create an idea or see if one already exists. 

 

I do hope somene in the community has a possible workaround or has done something similar though.  

Highlighted
Super User
Super User

Re: The opposite of the OnSelect() method

@samuelJ 

There was only 1 idea I could find and unfortunately it has only 1 vote.  However, your vote will double that and I can upvote it for you too.  https://powerusers.microsoft.com/t5/PowerApps-Ideas/OnFocus-Property/idi-p/247636

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (3,765)