imports/vx/client/code/ux.js
/**
     * Create a new error associated with the specified component.
     *
     * @param {object} component Component.
     * @param {string} localizedMessage Validation error message.
     * @param {boolean} requiredField True to signal required-field error.
     */
Create a new error associated with the specified component.
@param {object} component Component.
@param {string} localizedMessage Validation error message.
@param {boolean} requiredField True to signal required-field error.
Create a new error associated with the specified component . @param { object } component Component . @param { string } localizedMessage Validation error message . @param { boolean } requiredField True to signal required - field error .
addErrorToComponent(component, localizedMessage, requiredField) {
        component.setState({ error : true, localizedMessage : localizedMessage }, () => {
            UX.addError(component)
        })
        if (requiredField) {
            return
        }
        if (component.props.extra) {
            _.each(component.props.extra, (extraId) => {
                let extraComponent = UX.findComponentById(extraId)
                extraComponent.setState({ error : true, localizedMessage : localizedMessage }, () => {
                    UX.addError(component)
                })
            })
        }
    }
addErrorToComponent ( component , localizedMessage , requiredField ) { component . setState ( { error : true , localizedMessage : localizedMessage } , ( ) => { UX . addError ( component ) } ) if ( requiredField ) { return } if ( component . props . extra ) { _ . each ( component . props . extra , ( extraId ) => { let extraComponent = UX . findComponentById ( extraId ) extraComponent . setState ( { error : true , localizedMessage : localizedMessage } , ( ) => { UX . addError ( component ) } ) } ) } }
Create a new error associated with the specified component.
Create a new error associated with the specified component .
//component.props.addError(component) // No extra processing for required fields, flag first empty field only: //extraComponent.props.addError(extraComponent)