<?xml version='1.0' encoding='UTF-8'?>
<section>
  <sectioninfo>
    <keywordset>
      <keyword>messages</keyword>
      <keyword>rich:messages</keyword>
      <keyword>HtmlMessages</keyword>
    </keywordset>
  </sectioninfo>

  <table>
    <title>Component identification parameters </title>
    <tgroup cols="2">
      <thead>
        <row>
          <entry>Name</entry>
          <entry>Value</entry>
        </row>
      </thead>
      <tbody>
        <row>
          <entry>component-type</entry>
          <entry>org.richfaces.component.RichMessages</entry>
        </row>
        <row>
          <entry>component-class</entry>
          <entry>org.richfaces.component.html.HtmlRichMessages</entry>
        </row>
        <row>
          <entry>component-family</entry>
          <entry>org.richfaces.component.RichMessages</entry>
        </row>
        <row>
          <entry>renderer-type</entry>
          <entry>org.richfaces.renderkit.html.HtmlRichMessagesRendere</entry>
        </row>
        <row>
          <entry>tag-class</entry>
          <entry>org.richfaces.taglib.RichMessagesTag</entry>
        </row>
      </tbody>
    </tgroup>
  </table>

  <section>
    <title>Creating the Component with a Page Tag</title>
    <para>To create the simplest variant of <property>message</property> on a page, use the
      following syntax:</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
 	<rich:messages/>
...
]]></programlisting>
  </section>

  <section>
    <title>Creating the Component Dynamically Using Java</title>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="JAVA"><![CDATA[import  org.richfaces.component.html.HtmlRichMessages;
...
HtmlRichMessages myMessages = new HtmlRichMessages();
...
]]></programlisting>
  </section>

  <section>
    <title>Details of Usage</title>
    <para> The component has the same behavior as standard <emphasis role="bold">
        <property>&lt;h:message&gt;</property>
      </emphasis>component except next features: <itemizedlist>
        <listitem>It&apos;s ajaxRendered. It means that the component is reRendered after Ajax
          request automatically without outputPanel usage.</listitem>
        <listitem>The component optionally provides &quot;passed&quot; state which will be
          shown if no message to be displayed.</listitem>
        <listitem>Provides possibility to add some marker to message. By default, a marker element
          isn&apos;t shown.</listitem>
      </itemizedlist>
    </para>
    <para>The component provides two parts to be optionally defined: marker and informational label
      before the marker for every message.</para>
    <para> Set of facet which can be used for a marker defining: <itemizedlist>
      <listitem>passedMarker. This facet is provided to allow setting a marker to be displayed if there is no message.</listitem>
      <listitem>errorMarker. This facet is provided to allow setting a marker to be displayed if there is a message with a severity class of &quot;ERROR&quot;.</listitem>
      <listitem>fatalMarker. This facet is provided to allow setting a marker to be displayed if there is a message with a severity class of &quot;FATAL&quot;.</listitem>
      <listitem>infoMarker. This facet is provided to allow setting a marker to be displayed if there is a message with a severity class of &quot;INFO&quot;.</listitem>
      <listitem>warnMarker. This facet is provided to allow setting a marker to be displayed if there is an message with a severity class of &quot;WARN&quot;.</listitem>
      </itemizedlist>
    </para>

    <para>The following example shows different variants of customization of the component.</para>

    <para>
      <emphasis role="bold">Example:</emphasis>
    </para>
    <programlisting role="XML"><![CDATA[...
    <rich:messages layout="table" tooltip="true" showDetail="false" showSummary="true" passedLabel="No Errors" var="messages">
        <f:facet name="errorMarker">
            <h:graphicImage url="/image/error.png"/>
        </f:facet>
        <f:facet name="infoMarker">
            <h:graphicImage url="/image/info.png"/>
        </f:facet>
        <f:facet name="passedMarker">
            <h:graphicImage url="/image/passed.png"/>
        </f:facet> 
    </rich:messages>
...
]]></programlisting>

  </section>

  <section>
    <title>Look-and-Feel Customization</title>
    
    <para>For skinnability implementation, the components use a <emphasis>
      <property>style class redefinition method.</property>
    </emphasis></para>
    
    <para>There are no skin parameters and default predefined values. To redefine the appearance of all <emphasis
      role="bold">
      <property>&lt;rich:messages&gt;</property>
    </emphasis> components at once, you should only  add to your style sheets <emphasis>
      <property>style classes</property>
    </emphasis> used by a <emphasis
      role="bold">
      <property>&lt;rich:messages&gt;</property>
    </emphasis> component.</para>
    
  </section>

  <section>
    <title>Definition of Custom Style Classes</title>
    
    <para>On the screenshot there are classes names that define styles for component elements.</para>
    
    <figure>
      <title>Classes names</title>
      
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/messages1.png"/>
        </imageobject>
      </mediaobject>
    </figure>
    
    <table>
      <title>Classes names that define a component appearance</title>
      
      <tgroup cols="2">
        <thead>
          <row>
            <entry>Class name</entry>
            
            <entry>Description</entry>
          </row>
        </thead>
        
        <tbody>
          <row>
            <entry>rich-messages</entry>
            
            <entry>Defines styles for a wrapper element</entry>
          </row>
          
          <row>
            <entry>rich-messages-marker</entry>
            
            <entry>Defines styles for a marker</entry>
          </row>
          
          <row>
            <entry>rich-messages-label</entry>
            
            <entry>Defines styles for a label</entry>
          </row>
          
        </tbody>
      </tgroup>
    </table>

    <para>In order to redefine styles for all <emphasis role="bold">
      <property>&lt;rich:messages&gt;</property>
    </emphasis> components on a page using CSS, it&apos;s enough to create classes with the
      same names and define necessary properties in them.</para>
    
    <para>To change styles of particular <emphasis role="bold">
      <property>&lt;rich:messages&gt;</property>
    </emphasis> components, define your own style classes in the corresponding <emphasis
      role="bold">
      <property>&lt;rich:messages&gt;</property>
    </emphasis>attributes.</para>
  </section>
  <section>
    <title>Relevant Resources Links</title>
    <para><ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/messsages.jsf?c=messages"
      >Here</ulink> you can see the example of <emphasis role="bold"
        ><property>&lt;rich:messages&gt;</property></emphasis> usage and sources for the given example. </para>
  </section>   
</section>
