[ http://issues.apache.org/jira/browse/MYFACES-444?page=comments#action_12329971 ]
Martin Marinschek commented on MYFACES-444: ------------------------------------------- Ken, Ed has commented on your post - I add his answer here. Fancy doing a patch as to what he suggests ;) ? regards, Martin KW> The tld docs for <h:message> KW> (http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/ KW> tlddocs/h/message.html) are confusing with respect to KW> what the tooltip text should be when the tooltip KW> attribute is set to true. KW> KW> The attribute description for "tooltip" says: KW> So, should the detail always be displayed, or should KW> the summary be displayed when available, and if not, KW> the detail? Detail is displayed only iff showDetail is true, regardless of any other attribute settings. The only way to get a tooltip is to have showSummary, showDetail and tooltip set to true. In that case, the summary gets displayed as the tooltip by being the value of the title attribute on the span. However, if showSummary is true, while showDetail and tooltip are false, you'll just get the summary as inline text, not as a tooltip. KW> KW> Also, if the "title" attribute on KW> <h:message> is set to a value, should KW> that value override the detail and summary for the KW> tooltip? (In HTML, it is the title attribute that is KW> used to represent the tooltip). This is a good question and is unspecified. I think it was a mistake to include the title attribute but we did, so we have to support it. Therefore, I suggest we modify the spec for message and messages to state that if the title attribute is present, its value should be rendered as the tooltip, replacing the value taken from the message summary, if any. If you find this agreeable, I'll update the jira. Thanks, Ed (JSR-252 spec co-lead) > HtmlMessageRendererBase renders tooltip as message summary rather than detail > ----------------------------------------------------------------------------- > > Key: MYFACES-444 > URL: http://issues.apache.org/jira/browse/MYFACES-444 > Project: MyFaces > Type: Bug > Components: Implementation > Versions: 1.0.9m9 > Reporter: Ken Weiner > Assignee: Martin Marinschek > > The tooltip attribute description on > http://java.sun.com/j2ee/javaserverfaces/1.1/docs/tlddocs/h/message.html says > that the tooltip content should be composed of the message detail text. > However, the tooltip content in MyFaces is getting set to the message summary > text. This happens in HtmlMessageRendererBase in the > renderSingleFacesMessage() method. The code sets the title to the summary if > the tooltip is enabled. Otherwise it uses the title attribute: > String summary = getSummary(facesContext, message, facesMessage, > messageClientId); > String detail = getDetail(facesContext, message, facesMessage, > messageClientId); > String title = getTitle(message); > boolean tooltip = isTooltip(message); > if (title == null && tooltip) > { > title = summary; > } > Instead it should use the detail as follows: > String summary = getSummary(facesContext, message, facesMessage, > messageClientId); > String detail = getDetail(facesContext, message, facesMessage, > messageClientId); > String title = getTitle(message); > boolean tooltip = isTooltip(message); > if (title == null && tooltip) > { > title = detail; > } > It might be argued that the tooltip should be set to the detail regardless of > whether the title attribute is set at all since the description of the title > attribute is "Advisory title information about markup elements generated for > this component." If that is the case then the code should look like this: > String summary = getSummary(facesContext, message, facesMessage, > messageClientId); > String detail = getDetail(facesContext, message, facesMessage, > messageClientId); > String title = getTitle(message); > boolean tooltip = isTooltip(message); > if (tooltip) > { > title = detail; > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira