The team at Laserfiche has asked us to let them know use cases of things where we still use the Classic Designer, with the intent of trying to recreate that functionality in the Layout Designer or the LFForm interface.
I have two examples I use on nearly every form, that I can't currently re-create using the Layout Designer. I'd love to have a way to manage these in the Layout Designer, either built-in functionality or coding options with the LFForm interface.
The first is setting the page title (so it's something other than "New Submission"). I usually do this by setting it to the name of the task. To do that, I add a custom HTML element to my form with {/_current_step_name} as the content of the field, and a CSS class name of getCurrentStepName. Because it's a custom HTML element, it re-populates the content every time the form is loaded. Then I can use Javascript to set the page title to that value, like this:
//Set the page title. if($('.getCurrentStepName').text() != '') { $('title').text($('.getCurrentStepName').text()); }
The other one that I commonly use is associated with a notes table that I use on most forms. The table includes three fields, the date, the user's name, and a notes field. This is used by staff to add notes as forms move through the process, but I also automatically add notes when they complete a form task. We find this works better for our needs than the standard comments box or referring back to the instance history. The trick is the part about automatically adding the note. This is handled by watching for the action buttons to be clicked. After they are clicked, it forces the validation and if the validation succeeded, it will add a new note to the table with the name of the task (same custom html element used for the title) and the action taken (the title of the button). The code looks like this:
//add a note regarding form routing when the Submit button is clicked. $(".action-btn.Submit").on('click', function() { var noErrors = true; $('#form1').parsley().validate(); $('.parsley-error').each(function() { noErrors = false; }); if (noErrors) { //update the notes with the current action $('.notesTable .cf-table-add-row').trigger('click'); $('.notesTable tr:last').find('.notesNotes textarea').val("Task: " + $('.getCurrentStepName').text() + "\nFunction: " + $('.Submit').val()); } //end of if (noErrors) { }); //end of $(".action-btn.Submit").on('click', function() {
I have versions of that code for the different buttons: Submit, Approve, and Reject.
These are the kinds of things that I want to replicate with the Layout Designer and cannot current do it.