3 Replies Latest reply on Jul 30, 2009 4:29 AM by johndoe123

    Adjusting size of UIInput programmatically

      Hi,

      I want to adjust the size of the auto-generated filter-input of rich:datatable/rich:column.

      So far I've got this code:

      private void adjustFilterLength(FacesContext ctx)
       {
       UIComponent comp = ctx.getViewRoot();
      
       UIComponent datatable = findComponent(comp, "datatable");
       if (datatable == null)
       throw new FacesException("DATATABLE NOT FOUND");
      
       for (UIComponent kid : datatable.getChildren())
       {
       if (kid instanceof UIColumn)
       {
       UIInput filterValueInput = (UIInput) kid.getFacet("filterValueInput");
       if (filterValueInput != null)
       {
       System.out.println(filterValueInput.getClientId(ctx));
       filterValueInput.getAttributes().put("size", "3");
       }
      
       }
       }
       }


      That does not work and I do not know why? Can't I put HTML-Attributes in there? It won't work with JSF attributes either (I tried setting the value attribute).

      Can someone please provide me with a quick example. That'd be very nice indeed.

      Kind regards,
      John Doe