On a form, is it possible to hide the Cancel button, or if not, control the view the user goes to when Cancel is selected? Thank you.
Hi @Robert_Lerner,
If you put an expression like below in Cancel button’s expression option under UX - > Localize
IF(CONTEXT(“View”)=“Table OR Slice Name_Form”, “”,“Cancel”)
The cancel button gets hidden ( or to be precise becomes blank) for that particular form view.
Here, in the
expression,
“Table OR Slice Name_Form” is the name of system form view for the table or slice where you wish to hide the cancel button.
However, on impact of hiding “Cancel” button, the community colleagues may have their insights to share.
@Suvrutt_Gurjar Thanks so much for your perfect solution - it would never have occurred to me to use the localize option! For future readers of this post, I made a small change in the expression to:
IF( CONTEXT(“View”)=“MyViewName”, “”,“Cancel” )
Hi @Robert_Lerner, You are welcome and thank you for your update.Yes there was that minor typo in my expression, as I
tested it on two different views simultaneously and forgot to remove an “OR” while pasting.
I have corrected it in the original post as well.
perfect, thks
Robert_Lerner:
IF( CONTEXT(“View”)=“MyViewName”, “”,“Cancel” )
Thank You ^ ^
This seems to work no more. We need to use at least one space character like:
IF(CONTEXT("View")="MyViewName", " ","Cancel")
or a new line like:
IF(CONTEXT("View")="MyViewName", "
","Cancel")
Please also see:
[Detail Views: Space-Saving Trick to Display Columns Horizontally](https://community.appsheet.com/t/detail-views-space-saving-trick-to-display-columns-horizontally/14497/17) Tips & Tricks ?
“” or “” is not working to me. It will be ignored, and “View” is shown. [view] " " (with whitespace) is working. But as @Jonathon said, you will still have a clickable area- I marked it gray. And this happens no matter what kind of whitespace you are using. I tried it with hair space , thin space , six-per-em space. [Space] The best result I got from using this expression. It’s just a NewLine with no whitespace. " " [image] [Absatz] The clickable area gets very small.
this way of hiding the cancel button seems to work when using mobile and tablet, but not when i open the app using a desktop.
is anyone else experiencing the same and have a solution?