Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

Customizing can be done in several different ways. It is important to consider all the alternatives available when deciding on a method to accomplish form customization. Choosing an approach that is part of the product is like Business Rules a better choice since released versions undergo rigorous quality assurance testing. Custom behavior can be added to forms using JavaScripts, which will accomplish the task but are not subjected to formal testing. These customizations should only be used under special situations and if there is no other way to customize the form to the requirements.

Here  are some real world situations where a custom JavaScript can be used in a form. The Custom Java code can be added to the form using the Message Control or the custom.js file in a Theme. Refer to Customizing Behavior for more information.

Column
width240px

On This Page:

Table of Contents
maxLevel1

...

A Tab control with many fields in each tab, may require a long scroll to switch from one tab to another. You can use a trigger control at the bottom of the first tab with a business rule to navigate the user to the second tab when the trigger is clicked. For example, when you click on the Next Tab trigger control on the Personal Information tab in the Application for Employment form shown a business rule will navigate the user to the Employment History tab. 

You can use the following JavaScript to force the page to be scrolled to the top after switching to the second tab: 

...

You have a new customer registration Form ( A ) that is normally forwarded to Forms B and C to complete registration for a new user registration. Returning Users skip Form B and go directly to form C.  A  workflow with a precondition that skips a step or a templatized value of a control to decide where the user should be forwarded using Business Rules are recommended approaches and should be considered. This JavaScript allows the user to bypass a form when it is not required and can be used if the recommended approaches are not possible. It will automatically submit a form if a certain control has some specific value (say “not-new”) in it. 

...

Add conditional-submit to the CSS Class property of the control whose value is to be compared.

Extra Submit button

The default theme applied when forms are created in  has a submit By default, each form has a submit button located at the end of the form. The forms designer lets you easily add additonal submit buttons  in a special area at the end of a form only. You can use the following JavaScript to display create an extra submit button. Add a trigger control to your form and set auto-submit in the CSS Class property. Now you can use this trigger control as your Submit button and place it anywhere on your form.

...

Code Block
var CustomEventHandlers = {
   setup: function (el) {
       if (CustomView.hasClass(el, 'extra-submit')) {
           FEvent.observe(el, 'click', this.autoSubmit.bindAsObserver(this, el));
       }
   },
   autoSubmit: function (evt, el) {
       FlowView.getFlowButton().onclick();
   }
}

 

Prevent Session Timeout

The Sometimes you may need the session timeout for a particular form to be a lot longer than the default session timeout that makes sense for your entire tenant. Imagine your tenant session timeout in  is set to 30 minutes. One of your forms takes a long time to fill out. You want to allow idle periods greater than 30 minutes for that form only.

...

This JavaScript will change the session timeout for this form to 6 10 hours. Change the variable sessionInterval in the script to the desired time period, for example, a 2 4 hour session timeout would be:  var  var sessionInterval = 1000 * 60 * 2; // milliseconds to minutes .4; 

Code Block
var sessionInterval = 1000 * 60 * 10; // milliseconds to minutes
var sessionRefreshURL = "/frevvo/web/login";

refreshFrevvoSession = function () {

   // make the request
   var xmlhttp;
   if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
   else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5
   xmlhttp.open("GET", sessionRefreshURL + "?sessionRefresh=" + new Date().getTime(), true);
   xmlhttp.send();

   // set the timer to run again
   setTimeout(refreshFrevvoSession, sessionInterval);
}
setTimeout(refreshFrevvoSession, sessionInterval); // set the initial timer

...