code: @Override
  	public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
  		if (!component.isRendered()) {
  			return;
  		}
  		FetchBeanInfos fetchBeanInfos = (FetchBeanInfos) component;
  		ResponseWriter rw = context.getResponseWriter();
  		String clientId = fetchBeanInfos.getClientId();
  
  		boolean validationFailed = context.isValidationFailed();
  		Severity maximumSeverity = context.getMaximumSeverity();
  		String maximum="null";
  		if (maximumSeverity!=null) {
  			maximum=String.valueOf(maximumSeverity.getOrdinal());
  		}
  		String variables = "bfMaximumMessageSeverity=" + maximum + ";";
  		boolean hasFatalError = false;
  		boolean hasError = false;
  		boolean hasWarning = false;
  		boolean hasInfo = false;
  		List<FacesMessage> messageList = context.getMessageList();
  		for (FacesMessage message : messageList) {
  			if (FacesMessage.SEVERITY_FATAL.equals(message.getSeverity())) {
  				hasFatalError = true;
  			} else if (FacesMessage.SEVERITY_ERROR.equals(message.getSeverity())) {
  				hasError = true;
  			} else if (FacesMessage.SEVERITY_WARN.equals(message.getSeverity())) {
  				hasWarning = true;
  			} else if (FacesMessage.SEVERITY_INFO.equals(message.getSeverity())) {
  				hasInfo = true;
  			}
  		}
  		variables += "bfHasFatalError=" + hasFatalError + ";";
  		variables += "bfHasError=" + hasError + ";";
  		variables += "bfHasWarning=" + hasWarning + ";";
  		variables += "bfHasInfo=" + hasInfo + ";";
  
  		rw.startElement("script", fetchBeanInfos);
  		rw.writeAttribute("id", clientId, null);
  		rw.writeText("validationFailed=" + validationFailed + ";" + variables, null);
  		rw.endElement("script");
  	}
docs: This methods generates the HTML code of the current b:fetchBeanInfos.
  
  @param context
  the FacesContext.
  @param component
  the current b:fetchBeanInfos.
  @throws IOException
  thrown if something goes wrong when writing the HTML code.