Article
Problem
A Forum reader recently asked:
"I need an information about the ECMA-Script. Can I (and how should I) show/hide an Action Button (for example Submit, Cancel,..) from ECMA-Script? Does such a method exist?"
And here's the response from Rudy Duym ...
Solution
You can intercept the action that is behind the buttons, but you cannot show/hide buttons like you can with fields.
To intercept the action you do something like the following example. In this example, the submit action is intercepted and the form will be submitted only if the user replies yes:
form.interceptAction("SubmitAction", "around",
function (invocation) {
if (confirm( "Are you sure you want to submit ?")) {
var result = invocation.proceed(); return result;
}
}
);You can block the action when certain conditions are met, to block you do not call the invocation.proceed() function.
That said, you can of course do whatever you want from within Javascript (that is what the form script basically is, with some extra methods thrown into it) - you only have to know the ID of the HTML element on which to operate. But watch out: each command action is duplicated if you use the choice "both" (as opposed to top or bottom) for the action buttons.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.
Related Articles
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- 3456 reads


0