rice-framework/krad-web/src/main/webapp/krad/scripts/krad.validate.js
/**
 * Shows the message tooltip if there are messages for this field, otherwise hides it.  The showAndClose flag allows
 * the message to be closed automatically after some predetermined amount of time, and the change flag forces the
 * show call on the plugin to deal with potential placement issues that can occur.
 * @param fieldId id of the field to show the tooltip on
 * @param showAndClose when true, this tooltip will be shown and then closed after a certain length of time
 * @param change forces the tooltip show call to deal with placement issues when changing internal content
 */
Shows the message tooltip if there are messages for this field, otherwise hides it.  The showAndClose flag allows
the message to be closed automatically after some predetermined amount of time, and the change flag forces the
show call on the plugin to deal with potential placement issues that can occur.
@param fieldId id of the field to show the tooltip on
@param showAndClose when true, this tooltip will be shown and then closed after a certain length of time
@param change forces the tooltip show call to deal with placement issues when changing internal content
Shows the message tooltip if there are messages for this field otherwise hides it . The showAndClose flag allows the message to be closed automatically after some predetermined amount of time and the change flag forces the show call on the plugin to deal with potential placement issues that can occur . @param fieldId id of the field to show the tooltip on @param showAndClose when true this tooltip will be shown and then closed after a certain length of time @param change forces the tooltip show call to deal with placement issues when changing internal content
function showMessageTooltip(fieldId, showAndClose, change) {
    var field = jQuery("#" + fieldId);
    var data = getValidationData(field);
    if (data && data.useTooltip && data.messagingEnabled && !haltValidationMessaging) {
        var elementInfo = getHoverElement(fieldId);
        var tooltipElement = jQuery(elementInfo.element);
        if (elementInfo.type == "fieldset") {
            tooltipElement = tooltipElement.filter(".uif-tooltip");
        }
        var popoverData = tooltipElement.data(kradVariables.POPOVER_DATA);
        if (!popoverData) {
            popoverData = initializeTooltip(tooltipElement);
        }
        var hasMessages = jQuery("[data-messages_for='" + fieldId + "']").children().length;
        if (hasMessages) {
            if (data.tooltipTimer) {
                clearTimeout(data.tooltipTimer);
            }
            popoverData.options.content = jQuery("[data-messages_for='" + fieldId + "']").html();
            var show = true;
            if (showAndClose && !(data.serverErrors.length || data.serverWarnings.length || data.serverInfo.length)) {
                hideMessageTooltip(fieldId);
                show = false;
            }
            if (show) {
                if (!popoverData.shown) {
                    if (showAndClose) {
                        hideTooltips();
                    }
                    tooltipElement.popover("show");
                    var popover = jQuery(tooltipElement).next(".popover");
                    if (data.tooltipTheme) {
                        popover.addClass(data.tooltipTheme);
                    }
                    popoverData.shown = true;
                }
                else if (popoverData.shown) {
                    if (change) {
                        if (showAndClose) {
                            hideTooltips();
                        }
                        tooltipElement.popover("show");
                    }
                }
                if (showAndClose) {
                    data.tooltipTimer = setTimeout("hideMessageTooltip('" + fieldId + "')", 3000);
                    field.data(kradVariables.VALIDATION_MESSAGES, data);
                }
            }
        }
        else {
            hideMessageTooltip(fieldId);
        }
    }
}
function showMessageTooltip ( fieldId , showAndClose , change ) { var field = jQuery ( "#" + fieldId ) ; var data = getValidationData ( field ) ; if ( data && data . useTooltip && data . messagingEnabled && ! haltValidationMessaging ) { var elementInfo = getHoverElement ( fieldId ) ; var tooltipElement = jQuery ( elementInfo . element ) ; if ( elementInfo . type == "fieldset" ) { tooltipElement = tooltipElement . filter ( ".uif-tooltip" ) ; } var popoverData = tooltipElement . data ( kradVariables . POPOVER_DATA ) ; if ( ! popoverData ) { popoverData = initializeTooltip ( tooltipElement ) ; } var hasMessages = jQuery ( "[data-messages_for='" + fieldId + "']" ) . children ( ) . length ; if ( hasMessages ) { if ( data . tooltipTimer ) { clearTimeout ( data . tooltipTimer ) ; } popoverData . options . content = jQuery ( "[data-messages_for='" + fieldId + "']" ) . html ( ) ; var show = true ; if ( showAndClose && ! ( data . serverErrors . length || data . serverWarnings . length || data . serverInfo . length ) ) { hideMessageTooltip ( fieldId ) ; show = false ; } if ( show ) { if ( ! popoverData . shown ) { if ( showAndClose ) { hideTooltips ( ) ; } tooltipElement . popover ( "show" ) ; var popover = jQuery ( tooltipElement ) . next ( ".popover" ) ; if ( data . tooltipTheme ) { popover . addClass ( data . tooltipTheme ) ; } popoverData . shown = true ; } else if ( popoverData . shown ) { if ( change ) { if ( showAndClose ) { hideTooltips ( ) ; } tooltipElement . popover ( "show" ) ; } } if ( showAndClose ) { data . tooltipTimer = setTimeout ( "hideMessageTooltip('" + fieldId + "')" , 3000 ) ; field . data ( kradVariables . VALIDATION_MESSAGES , data ) ; } } } else { hideMessageTooltip ( fieldId ) ; } } }
Shows the message tooltip if there are messages for this field, otherwise hides it.
Shows the message tooltip if there are messages for this field otherwise hides it .
//if there is a timer for this field in place, stop the timer from completing, to handle the new
 //show logic
 //only do a timed close if there are also server messages left - means you got a new client
 //side error that has to be demonstrated visually to the user (it would have no visual indication
 //if we just closed immediately)
 //close other bubble popups so we dont get too many during fast tabbing
 //if the messages shown were changed, reshow to get around placement issues
 //close other bubble popups so we dont get too many during fast tabbing
 //setup a timer to close the tooltip automatically
