All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.primefaces.message.message.js Maven / Gradle / Ivy

There is a newer version: 14.0.0
Show newest version
/**
 * __PrimeFaces Message Widget__
 * 
 * Message is a pre-skinned extended version of the standard JSF message component.
 * 
 * @interface {PrimeFaces.widget.MessageCfg} cfg The configuration for the {@link  Message| Message widget}.
 * You can access this configuration via {@link PrimeFaces.widget.BaseWidget.cfg|BaseWidget.cfg}. Please note that this
 * configuration is usually meant to be read-only and should not be modified.
 * @extends {PrimeFaces.widget.BaseWidgetCfg} cfg
 * 
 * @prop {string} cfg.target Client ID of the target for which to show this message.
 */
PrimeFaces.widget.Message = PrimeFaces.widget.BaseWidget.extend({

    /**
     * @override
     * @inheritdoc
     * @param {PrimeFaces.PartialWidgetCfg} cfg
     */
    init: function(cfg) {
        this._super(cfg);

        var text = this.jq.find('.ui-message-error-detail').text();

        if(text) {
           var target = $(PrimeFaces.escapeClientId(this.cfg.target));

           if (this.cfg.tooltip) {
              target.data('tooltip', text);
           }

           target.attr('aria-describedby', this.id + '_error-detail');
        }
    }
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy