rice-framework/krad-web/src/main/webapp/krad/scripts/krad.message.js
/**
 * Uses jQuery blockUI plug-in to show a loading notification
 *
 * <p>
 * The loading functionality is used to block an area of the screen and to display a message while
 * a request is being processed. If elementToBlock is given (known as a refresh block), the blocking will occur
 * only on the area covered by that element. Else the entire window will be blocked (known as navigation blocking).
 * </p>
 *
 * <p>
 * Depending on whether the blocking is for a refresh or navigation, separate blockUI defaults will be used. These
 * defaults are initialized through the View object or script
 * </p>
 *
 * @param loadingMessage - (optional) message to display while blocking, defaults to 'Loading...'
 * @param elementToBlock - (optional) jQuery object representing an element that should be blocked, defaults to
 * entire window if not given
 * @param replaceElement - (optional) boolean that indicates to replace the element contents with the loading
 * notification instead of an overlay, defaults to false
 * @param options - (optional) adding plug-in options for blockUI
 */
Uses jQuery blockUI plug-in to show a loading notification


The loading functionality is used to block an area of the screen and to display a message while
a request is being processed. If elementToBlock is given (known as a refresh block), the blocking will occur
only on the area covered by that element. Else the entire window will be blocked (known as navigation blocking).


Depending on whether the blocking is for a refresh or navigation, separate blockUI defaults will be used. These
defaults are initialized through the View object or script



Uses jQuery blockUI plug - in to show a loading notification The loading functionality is used to block an area of the screen and to display a message while a request is being processed . If elementToBlock is given ( known as a refresh block ) the blocking will occur only on the area covered by that element . Else the entire window will be blocked ( known as navigation blocking ) . Depending on whether the blocking is for a refresh or navigation separate blockUI defaults will be used . These defaults are initialized through the View object or script
function showLoading(loadingMessage, elementToBlock, replaceElement, options) {
    var context = getContext();
    if (elementToBlock && elementToBlock.length) {
        var blockingOptions = context.blockUI.defaults.refreshOptions || {};
        var loadingContent = refreshImage;
    }
    else {
        var blockingOptions = context.blockUI.defaults.navigationOptions || {};
        var loadingContent = navigationImage;
    }
    if (!loadingMessage) {
        loadingMessage = getMessage(kradVariables.MESSAGE_LOADING);
    }
    if (!loadingMessage || loadingMessage === "null") {
        loadingMessage = "Loading...";
    }
    loadingContent = loadingContent.attr("alt", loadingMessage).get(0).outerHTML + " " + loadingMessage;
    if (elementToBlock && elementToBlock.length) {
        if (replaceElement) {
            elementToBlock.html(loadingContent);
        }
        else {
            blockingOptions = jQuery.extend(blockingOptions, {message:loadingContent});
            elementToBlock.block(blockingOptions);
        }
    }
    else {
        loadingContent = '<h1>' + loadingContent + '</h1>';
        blockingOptions = jQuery.extend(blockingOptions, {message:loadingContent});
        context.blockUI(blockingOptions);
    }
}
function showLoading ( loadingMessage , elementToBlock , replaceElement , options ) { var context = getContext ( ) ; if ( elementToBlock && elementToBlock . length ) { var blockingOptions = context . blockUI . defaults . refreshOptions || { } ; var loadingContent = refreshImage ; } else { var blockingOptions = context . blockUI . defaults . navigationOptions || { } ; var loadingContent = navigationImage ; } if ( ! loadingMessage ) { loadingMessage = getMessage ( kradVariables . MESSAGE_LOADING ) ; } if ( ! loadingMessage || loadingMessage === "null" ) { loadingMessage = "Loading..." ; } loadingContent = loadingContent . attr ( "alt" , loadingMessage ) . get ( 0 ) . outerHTML + " " + loadingMessage ; if ( elementToBlock && elementToBlock . length ) { if ( replaceElement ) { elementToBlock . html ( loadingContent ) ; } else { blockingOptions = jQuery . extend ( blockingOptions , { message : loadingContent } ) ; elementToBlock . block ( blockingOptions ) ; } } else { loadingContent = '<h1>' + loadingContent + '</h1>' ; blockingOptions = jQuery . extend ( blockingOptions , { message : loadingContent } ) ; context . blockUI ( blockingOptions ) ; } }
Uses jQuery blockUI plug-in to show a loading notification
Uses jQuery blockUI plug - in to show a loading notification
// There is a very rare case where the message can be null - unknown cause
