-
1. Re: Display icon only with rich:message
sivaprasad9394 Nov 5, 2012 1:57 AM (in response to jmsjr) -
2. Re: Display icon only with rich:message
jmsjr Nov 5, 2012 4:34 AM (in response to sivaprasad9394)Siva Prasad wrote:
Hi jmsjr,
Go through the below link,
https://community.jboss.org/thread/164922
Thanks,
Siva
Hi Siva,
I did saw that earlier, but what he did in that other post is sort of similar to what I am doing here. To quote from the working solution in that post:
<composite:implementation>
<style type="text/css">
.message-icon .rf-msg-err {
display: inline;
visibility: visible;
}
.message-icon .rf-msg-det {
display: none;
visibility: hidden;
}
</style>
<a4j:commandLink disabled="true">
<rich:message for="#{cc.attrs.forId}" styleClass="message-icon"
onmouseover="#{rich:component('tooltip')}.show(event);" />
<rich:tooltip id="tooltip">
<rich:message for="#{cc.attrs.forId}" styleClass="message-text" />
</rich:tooltip>
</a4j:commandLink>
</composite:implementation>
So namely:
--> Change the CSS class rf-msg-det so that it is invisible / hidden. Same as what I have done above. This should basically hide the actual text of the message text.
But, in my case, both the icon AND the text are not visible.
I have now even changed the CSS file as below:
{code}
.message-icon .rf-msg-err{
background-image: url('#{facesContext.externalContext.requestContextPath}/resources/images/error.gif');
display: inline;
visibility: visible;
}
.rf-msg-det{
display: none;
visibility: hidden;
}
.rf-msgs-err{
background-image: url('#{facesContext.externalContext.requestContextPath}/resources/images/error.gif');
}
{code}
.. and used:
{code}
<rich:message for="input1" styleClass="message-icon"/>
{code}
... to use the same CSS class that was used in that other post.... and still BOTH text and icon are invisible.
Generated HTML is:
{code}
<span class="rf-msg message-icon" id="j_idt5:j_idt8">
<span class="rf-msg-err" id="j_idt5:j_idt8:j_idt5:input1">
<span class="rf-msg-det">Input1 is required</span>
</span>
</span>
{code}
So ... I am confused.
-
3. Re: Display icon only with rich:message
jmsjr Nov 6, 2012 5:46 AM (in response to jmsjr)The CSS changes actually work in IE9 and Chrome, but does not work in IE8. You need to have:
{code}
<meta http-equiv="X-UA-Compatible" content="IE=8" />
{code}
.. if you just want to have the icon only ( but not the message ) displayed for <rich:message>