rice-framework/krad-web/src/main/webapp/krad/scripts/krad.utility.js
/**
 * Retrieves the actual value from the input widget specified by name
 */
Retrieves the actual value from the input widget specified by name
Retrieves the actual value from the input widget specified by name
function coerceValue(name) {
    var value = "";
    var nameSelect = "[name='" + escapeName(name) + "']";
    var fancyBoxWrapper = jQuery("#fancybox-wrap");
    var control;
    if (fancyBoxWrapper.length) {
        control = jQuery(nameSelect, fancyBoxWrapper);
    }
    if (control == null || control.length == 0) {
        control = jQuery(nameSelect, document);
    }
    if (control.is(":checkbox") && control.length == 1) {
        value = control.filter(":checked").val();
    }
    else if (control.is(":checkbox") && control.length > 1) {
        value = [];
        control.filter(":checked").each(function () {
            value.push(jQuery(this).val());
        });
    }
    else if (control.is(":radio")) {
        value = control.filter(":checked").val();
    }
    else if (control.length) {
        if (control.hasClass("watermark")) {
            jQuery.watermark.hide(control, parent);
            value = control.val();
            jQuery.watermark.show(control, parent);
        }
        else {
            value = control.val();
        }
    }
    if (value == null) {
        value = "";
        return value;
    }
    if (value && !jQuery.isArray(value)) {
        if (value.toUpperCase() == "TRUE") {
            value = true;
        } else if (value.toUpperCase() == "FALSE") {
            value = false;
        }
    }
    return value;
}
function coerceValue ( name ) { var value = "" ; var nameSelect = "[name='" + escapeName ( name ) + "']" ; var fancyBoxWrapper = jQuery ( "#fancybox-wrap" ) ; var control ; if ( fancyBoxWrapper . length ) { control = jQuery ( nameSelect , fancyBoxWrapper ) ; } if ( control == null || control . length == 0 ) { control = jQuery ( nameSelect , document ) ; } if ( control . is ( ":checkbox" ) && control . length == 1 ) { value = control . filter ( ":checked" ) . val ( ) ; } else if ( control . is ( ":checkbox" ) && control . length > 1 ) { value = [ ] ; control . filter ( ":checked" ) . each ( function ( ) { value . push ( jQuery ( this ) . val ( ) ) ; } ) ; } else if ( control . is ( ":radio" ) ) { value = control . filter ( ":checked" ) . val ( ) ; } else if ( control . length ) { if ( control . hasClass ( "watermark" ) ) { jQuery . watermark . hide ( control , parent ) ; value = control . val ( ) ; jQuery . watermark . show ( control , parent ) ; } else { value = control . val ( ) ; } } if ( value == null ) { value = "" ; return value ; } if ( value && ! jQuery . isArray ( value ) ) { if ( value . toUpperCase ( ) == "TRUE" ) { value = true ; } else if ( value . toUpperCase ( ) == "FALSE" ) { value = false ; } } return value ; }
Retrieves the actual value from the input widget specified by name
Retrieves the actual value from the input widget specified by name
// Attempt to get from fancybox first, if it exists
 // If no fancybox or control not in fancybox, get from document
 // boolean matching
