What is the best way to code such. There is one major problem I can't solve. And looking at the Tomahawk implementation is really confusing, they have at least twelve files for the (Html)Message while I think three should be enought to create a custom tag (in my case: MessageIconTag, UIMessageIcon, MessageIconRenderer).
I do have a working prototype, but this deals with a major problem, so I think my whole concept is wrong. The problem is how to address the related components, the input and the label. They are all linked by the id-attribute of the input and the for-attributes of label and message(Icon). But what I have when rendering the message is the pure id from the for-attribute and the jsf generated clientIds of getClientIdsWithMessages(). What is the way to get the belonging input component. It can't be based on literal matching (as I do now). Especially within a list the ids defined in jsp code are not unique (the JSF generated clientIds are, but how to match them?).
A stupid little idea I have (to work around all this internals) is to actually use a Tomahawk HtmlMessage (in UIMessageIcon) and with a bit heavy magic get its values (the current error message, including resolved label) without rendering it (in MessageIconRenderer), to use this values on my own to render components (HtmlOutputLink and HtmlGraphicImage). Is this possible?
On the other hand for another component I need to get the related input component as well (to get it's required value to display an required mark - or not). So a way to solve this would really be great.
Or just some hints to find my way through the Tomahawk code...
okay, I've done the trick myself. Just using findComponent() does it, it's obviously clever enough to be aware of it's context, in lists for example. And for my needed "replaceIdWithLabel" feature the solution is in org.apache.myfaces.renderkit.html.ext.HtmlMessageRenderer.getOutputLabelMap().