imports/vx/client/code/ux.js
/**
     * Check the component comparing its value with its required field, taking into
     * account the special case of tandem fields.  Create form errors and alerts
     * as necessary.
     *
     * @param {object} component Component to check.
     * @return {boolean} True if all required components have values.
     */
Check the component comparing its value with its required field, taking into
account the special case of tandem fields.  Create form errors and alerts
as necessary.

@param {object} component Component to check.
@return {boolean} True if all required components have values.
Check the component comparing its value with its required field taking into account the special case of tandem fields . Create form errors and alerts as necessary . @param { object } component Component to check . @return { boolean } True if all required components have values .
checkComponentRequired(component) {
        let popoverComponent = null
        let valid = true
        if (component.props.required) {
            if (component.props.tandem) {
                let tandemComponent = UX.findComponentById(component.props.tandem)
                if (tandemComponent) {
                    if (!Util.isNullish(component.getValue()) && Util.isNullish(tandemComponent.getValue())) {
                        valid = false
                        popoverComponent = tandemComponent
                    }
                    if (Util.isNullish(component.getValue()) && !Util.isNullish(tandemComponent.getValue())) {
                        valid = false
                        popoverComponent = component
                    }
                }
                else {
                    OLog.error("ux.js checkComponentRequired unable to find tandem componentId=" + component.props.tandem)
                    valid = false
                }
            }
            else {
                if (Util.isNullish(component.getValue())) {
                    valid = false
                    popoverComponent = component
                }
            }
            if (!valid) {
                UX.addErrorToComponent(popoverComponent, Util.i18n("common.required_field_here"), true)
                UX.notify({ success : false, icon : "TRIANGLE", key : "common.required_fields_incomplete"})
                return false
            }
        }
        return true
    }
checkComponentRequired ( component ) { let popoverComponent = null let valid = true if ( component . props . required ) { if ( component . props . tandem ) { let tandemComponent = UX . findComponentById ( component . props . tandem ) if ( tandemComponent ) { if ( ! Util . isNullish ( component . getValue ( ) ) && Util . isNullish ( tandemComponent . getValue ( ) ) ) { valid = false popoverComponent = tandemComponent } if ( Util . isNullish ( component . getValue ( ) ) && ! Util . isNullish ( tandemComponent . getValue ( ) ) ) { valid = false popoverComponent = component } } else { OLog . error ( "ux.js checkComponentRequired unable to find tandem componentId=" + component . props . tandem ) valid = false } } else { if ( Util . isNullish ( component . getValue ( ) ) ) { valid = false popoverComponent = component } } if ( ! valid ) { UX . addErrorToComponent ( popoverComponent , Util . i18n ( "common.required_field_here" ) , true ) UX . notify ( { success : false , icon : "TRIANGLE" , key : "common.required_fields_incomplete" } ) return false } } return true }
Check the component comparing its value with its required field, taking into
 account the special case of tandem fields.
Check the component comparing its value with its required field taking into account the special case of tandem fields .