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
Remove 'Cancel' button on form called from a process
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Remove 'Cancel' button on form called from a process
the process
there's a property
'allow cancel'
set to no
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
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Remove 'Cancel' button on form called from a process
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)
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Remove 'Cancel' button on form called from a process
Jaymer, both processes have the "Allow Cancel" checkbox unchecked. I assume that is what you are referring to.
Re: Remove 'Cancel' button on form called from a process
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?
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?
-
- Posts: 303
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Remove 'Cancel' button on form called from a process
Thanks Bruce,
Would that also remove the 'Save' and 'Close' buttons from the form too?
Would that also remove the 'Save' and 'Close' buttons from the form too?
Re: Remove 'Cancel' button on form called from a process
yes, because it is searching for id aw_buttons. need to trick up the JQuery
Re: Remove 'Cancel' button on form called from a process
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).
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).
Henrik (V8 Developer Ed. - Windows)
Re: Remove 'Cancel' button on form called from a process
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.
$('[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.