}
protected void encodeAll(FacesContext context, RenderingContext arc,
UIComponent component, FacesBean bean) throws IOException
{
Agent agent = arc.getAgent();
// BlackBerry browser does not support inline style of display:none
// and thus it is necessary to slip rendering entire element if
// there is no message to display and rendering to BlackBerry.
// This method checks for the condition and returns true.
if (agent != null && Agent.AGENT_BLACKBERRY.equals(agent.getAgentName()))
{
boolean hasMessages =
FacesContext.getCurrentInstance().getMessages().hasNext();
if (!hasMessages)
{