The most common use case I have to use Java for is when I have a task that requires more than three decisions. Submit, Approve and Reject are not enough. This particular example is Approve, Reject, Abstain, and Add to Agenda. In this case we use a decision drop down and hide or show the appropriate button for that decision.
I love, love, love what the new forms designer allows us to do. I want to use it so bad for everything, but I find that if I begin a design in the New Designer I really handicap myself for things like this and wind up having to rebuild the whole form in classic to accommodate a new decision we discovered post-analysis.
***Suggestion for LF Developers: You could allow Field Rules to control the buttons. That would solve for this.***
I'd love to hear other use cases here for Java that have really been a staple in your form design.
Java I use most often below:
$(document).ready(function() { var $submit = $('.Submit'); var $approve = $('.Approve'); var $reject = $('.Reject'); var $Decision = $('#Field66'); //update with your target decision field $approve.hide(); $submit.hide(); $reject.hide(); $Decision.change(function() { if ($Decision.find(':selected').val() === "Approve"){ $approve.show(); $submit.hide(); $reject.hide(); } else if ($Decision.find(':selected').val() === "Abstain"){ $approve.hide(); $submit.show(); $reject.hide(); } else if ($Decision.find(':selected').val() === "Reject"){ $approve.hide(); $submit.hide(); $reject.show(); } else if ($Decision.find(':selected').val() === "Agenda"){ $approve.hide(); $submit.show(); $reject.hide(); } else { $approve.hide(); $submit.hide(); $reject.hide(); } }); });