| org.sakaiproject.tool.section.jsf.DivMessageRendererBase org.sakaiproject.tool.section.jsf.DivMessagesRenderer
DivMessagesRenderer | public class DivMessagesRenderer extends DivMessageRendererBase (Code) | | Work around JSF 1.1's inadequate Messages renderer, which has the following problems:
- Contrary to the documentation, an HTML list is not used to render a list. Instead,
the message texts are written out one after another.
- There's no way to define styles or classes for the containing HTML element.
- Each message is put into a "span" element rather than a "div". This means that
important formatting options are not available to page designers.
Of these, the worst problem seems the use of "span" instead of "div". Not many friendly
UIs will present messages to the user in a bulleted or numbered list, and since
each row only has one cell, the "table" capabilities aren't much different than one
would get from "div"s. So this overriding renderer uses "div" instead.
TODO Implement "table" and "list", and the trimmings ("detail", "title", etc.) to
make this a full replacement.
TODO Possibly add a TLD to make styling the container possible.
To replace the JSF renderer with no further fuss, just paste this into faces-config.xml :
javax.faces.Messages
javax.faces.Messages
org.sakaiproject.tool.section.jsf.DivMessagesRenderer
Notes added by JH below:
This messages renderer will check in two places for faces messages: in the
faces context, and in the session-scoped messagesBean.
|
Method Summary | |
public void | encodeEnd(FacesContext context, UIComponent component) |
encodeEnd | public void encodeEnd(FacesContext context, UIComponent component) throws IOException(Code) | | |
Methods inherited from org.sakaiproject.tool.section.jsf.DivMessageRendererBase | public String getMessageClass(UIComponent component, FacesMessage message)(Code)(Java Doc) public String getMessageStyle(UIComponent component, FacesMessage message)(Code)(Java Doc) public void renderMessage(FacesContext context, UIComponent component, FacesMessage message) throws IOException(Code)(Java Doc)
|
|
|