Package javax.faces.context

Examples of javax.faces.context.ResponseWriter.writeAttribute()


  protected void renderAttribute(FacesContext facesContext, UIComponent component, String name) throws IOException {

    ResponseWriter responseWriter = facesContext.getResponseWriter();
    Object object = component.getAttributes().get(name);
    if (object != null) {
      responseWriter.writeAttribute(name, "" + object, name);
    }
  }
 
  /**
   * <p>Render component attributes using ATTRIBUTE annotations.</p>
View Full Code Here


                  + " attribute "
                  + name
                  + "="
                  + stringBuffer.toString());
            }
            responseWriter.writeAttribute(name, stringBuffer.toString(), name);
         
        }       
      }       
    }   
  }
View Full Code Here

      stringBuffer.append("triggerBindedMethod('");
      stringBuffer.append(component.getClientId(facesContext));
      stringBuffer.append("','");
      stringBuffer.append(attributeName);
      stringBuffer.append("');");           
      responseWriter.writeAttribute(attributeName, stringBuffer.toString(), attributeName);           
    }
    else {
      // Probably a javascript event handler ...
      Object value = component.getAttributes().get(attributeName);
      if(value != null){
View Full Code Here

    else {
      // Probably a javascript event handler ...
      Object value = component.getAttributes().get(attributeName);
      if(value != null){
        stringBuffer.append(value);
        responseWriter.writeAttribute(attributeName, stringBuffer.toString(), attributeName);
      }
    }
  }
 
 
View Full Code Here

    if (disabled != null) {
      if (disabled.booleanValue()) {
        if (log.isDebugEnabled()) {
          log.debug("Component " + component.getClass().getName() + " " + component.getId() + " attribute disabled=" + disabled);
        }
        responseWriter.writeAttribute("disabled", disabled.toString(), "disabled");
      }
    }
  }
 
  /**
 
View Full Code Here

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
    super.encodeBegin(facesContext, component);
    ResponseWriter responseWriter = facesContext.getResponseWriter();
    responseWriter.startElement("grid", component);
    responseWriter.writeAttribute("id", component.getClientId(facesContext), "id");
    renderAttributes(facesContext, component, (List) component
        .getAttributes().get("annotatedAttributes"));
  }

  @Override
View Full Code Here

      if (var != null) {
        Map sessionMap = facesContext.getExternalContext().getSessionMap();
        synchronized (sessionMap) {
          responseWriter.startElement("treechildren",component);
          treeChildrenComponent.setNodeId(component.getClientId(facesContext));
          responseWriter.writeAttribute("id",treeChildrenComponent.getNodeId(), "id");
          renderAttributes(facesContext,component,(List) component.getAttributes().get("annotatedAttributes"));
          for (int i = 0; i < treeNode.getChildCount(); i++) {
            encodeTreeNode(facesContext, component, (DefaultMutableTreeNode) treeNode.getChildAt(i), i,"" + i );
          }
          responseWriter.endElement("treechildren");
View Full Code Here

    Object value = gridComponent.getValue();
    if (value != null) {
      responseWriter.startElement("rows", component);
      String rowsId = gridComponent.getClientId(facesContext)+"_rows";
      responseWriter.writeAttribute("id",rowsId,"id");
            
      if (value instanceof Collection) {
       
        int first = gridComponent.getFirst();
        int rows = gridComponent.getRows();
View Full Code Here

 
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
    super.encodeBegin(facesContext, component);               
    ResponseWriter responseWriter = facesContext.getResponseWriter();
    responseWriter.startElement("description",component);
    responseWriter.writeAttribute("id",component.getClientId(facesContext), "id");           
    renderAttributes(facesContext, component, (List) component
        .getAttributes().get("annotatedAttributes"));
  }
 
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
View Full Code Here

public class LabelRenderer extends OutputRenderer {

  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {                   
    ResponseWriter responseWriter = facesContext.getResponseWriter();
    responseWriter.startElement("label",component);
    responseWriter.writeAttribute("id",component.getClientId(facesContext), "id");
   
    String value = getValueAsString(facesContext,(UIOutput) component);
    responseWriter.writeAttribute("value", "" +value , "value");
   
    renderAttributes(facesContext, component, (List) component
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.