Remove 'Cancel' button on form called from a process

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Remove 'Cancel' button on form called from a process

Post by Jhstephenson »

I have the following:

On a visual perspective I have some Static HTML that displays some buttons. One of them calls a process that Initializes some Session Variables and then calls a query.

On the query I have a Record Operation that calls another process when a record is clicked on. That process checks to see if the person logged in is a Participant in a case and if they are it sets another session variable. Then the process does a VIEW Case USING 'Main'.

So far everything works just like I want it to.

However, on the form that is called it has 'Save', 'Close', and 'Cancel' buttons. I don't want the 'Cancel' button. How do I keep that from showing up?

The two processes that are called in this procedure both have 'Allow Cancel' not checked.

I know I am missing something, but cannot see what it is.

Thanks,
Jim
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Remove 'Cancel' button on form called from a process

Post by Jaymer »

the process
there's a property
'allow cancel'
set to no
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Remove 'Cancel' button on form called from a process

Post by hpl123 »

I find these pop up here and there without me fully knowing why. One last resort if you can´t figure it out is removing the button (s) with some JS script and I do this here and there when I can´t get Aware to do what I want.
Henrik (V8 Developer Ed. - Windows)
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Remove 'Cancel' button on form called from a process

Post by Jhstephenson »

Jaymer, both processes have the "Allow Cancel" checkbox unchecked. I assume that is what you are referring to.
BLOMASKY
Posts: 1470
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Remove 'Cancel' button on form called from a process

Post by BLOMASKY »

I am a JQuery dummy, but:

Add script in form render:
$(".aw-form-buttons").css ("display", "none");

will remove all buttons, so should be able to find the cancel button and do the same? Maybe?
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Remove 'Cancel' button on form called from a process

Post by Jhstephenson »

Thanks Bruce,

Would that also remove the 'Save' and 'Close' buttons from the form too?
BLOMASKY
Posts: 1470
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Remove 'Cancel' button on form called from a process

Post by BLOMASKY »

yes, because it is searching for id aw_buttons. need to trick up the JQuery
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Remove 'Cancel' button on form called from a process

Post by hpl123 »

The jQuery script above will remove all buttons yes and if you need to only remove the cancel button, you need to find it with jQuery and is the first part of the script (.aw-form-buttons etc. part) and I tried looking for scripts in my BSVs of where I might have done this but couldn´t find any (massive BSVs). What I did if I remember correctly was use some type of "contains" selector e.g button id/name contains cancel or something like that.

If the scripting is to complex etc., another thing you can do that I often do is remove the default buttons via the script provided above and then create your own "Save" and "Close" buttons and place them in the bottom toolbar of the form. This means you get more or less full control over buttons, location, style etc. etc. and you can also add other things like "Delete" and style it red etc. etc.. Works great but one thing you might come across is, you may have to style the bottom toolbar a bit with CSS so it works better together with the form. I have for example styled my bottom toolbar so it looks exactly like the toolbar with the form default buttons (see attached example).
example.png
example.png (67.35 KiB) Viewed 2061 times
Henrik (V8 Developer Ed. - Windows)
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Remove 'Cancel' button on form called from a process

Post by idpSteve »

You should be able to use something like this in the render script of the form:

$('[id*="_cancel_button"]').hide();

If that doesn't work for you use the inspector to find a part of the cancel button's ID that you can match, and use that.
Post Reply